"error: Unexpected @FunctionalInterface annotation"

164 views
Skip to first unread message

Performant Data LLC

unread,
Mar 30, 2016, 4:34:49 PM3/30/16
to scala-internals
I'm seeing errors like this in the Ant build output. Ideas on how to get this to build?

quick.lib:
    [javac] Compiling 122 source files to .../scala/build/quick/classes/library
    [javac] .../scala/src/library/scala/runtime/java8/JFunction1$mcDD$sp.java:8: error: Unexpected @FunctionalInterface annotation
    [javac] @FunctionalInterface
    [javac] ^
    [javac]   JFunction1$mcDD$sp is not a functional interface
    [javac]     multiple non-overriding abstract methods found in interface JFunction1$mcDD$sp
    [javac] .../scala/src/library/scala/runtime/java8/JFunction1.java:8: error: Unexpected @FunctionalInterface annotation
    [javac] @FunctionalInterface
    [javac] ^
    [javac]   JFunction1 is not a functional interface
    [javac]     multiple non-overriding abstract methods found in interface JFunction1
    [javac] .../scala/src/library/scala/runtime/java8/JFunction1$mcDF$sp.java:8: error: Unexpected @FunctionalInterface annotation
    [javac] @FunctionalInterface
    [javac] ^
    [javac]   JFunction1$mcDF$sp is not a functional interface
    [javac]     multiple non-overriding abstract methods found in interface JFunction1$mcDF$sp
    [javac] .../scala/src/library/scala/runtime/java8/JFunction1$mcDI$sp.java:8: error: Unexpected @FunctionalInterface annotation
    [javac] @FunctionalInterface
    [javac] ^
    [javac]   JFunction1$mcDI$sp is not a functional interface
    [javac]     multiple non-overriding abstract methods found in interface JFunction1$mcDI$sp


Performant Data LLC

unread,
Mar 30, 2016, 4:35:56 PM3/30/16
to scala-internals
This is in the 2.12.x branch, which I'm just starting to use. 2.11.x builds OK.

Adriaan Moors

unread,
Mar 30, 2016, 4:41:18 PM3/30/16
to scala-i...@googlegroups.com
Not sure what's going on. Are you on Java 8? Clean build? Which commit of 2.12.x?
Could you share ant's startup banner, which has some of this info?

On Wed, Mar 30, 2016 at 1:35 PM, Performant Data LLC <perform...@gmail.com> wrote:
This is in the 2.12.x branch, which I'm just starting to use. 2.11.x builds OK.

--
You received this message because you are subscribed to the Google Groups "scala-internals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-interna...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Performant Data LLC

unread,
Mar 30, 2016, 4:56:48 PM3/30/16
to scala-internals

Clean build?

I did an "ant clean", but had to run "ant" a few times between that and this failure, because it was failing to get files from Maven Central.
 
Which commit of 2.12.x?

e5bbc98f
 
Could you share ant's startup banner

$ ant
Buildfile: .../scala/build.xml

desired.jars.uptodate:

boot:

init.git:

init:
     [copy] Copying 2 files to .../scala/build/deps/junit
     [copy] Copying 29 files to .../scala/build/deps/pax.exam
     [copy] Copying 1 file to .../scala/build/deps/asm
     [copy] Copying 4 files to .../scala/build/deps/partest
     [copy] Copying 1 file to .../scala/build/deps/repl
     [copy] Copying 3 files to .../scala/build/deps/scaladoc
     [echo] Using Scala 2.12.0-M3-dc9effe for STARR.
     [copy] Copying 5 files to .../scala/build/deps/starr
     [echo]        build time: 30 March 2016, 13:15:30
     [echo]      java version: OpenJDK 64-Bit Server VM 1.8.0_66-internal (1.8)
     [echo]         java args: -Xms1536M -Xmx1536M -Xss1M -XX:+UseParallelGC
     [echo]        javac args:
     [echo]       scalac args: -feature 
     [echo] scalac quick args: -feature 
     [echo]          git date: 20160329-232805
     [echo]          git hash: e5bbc98f78
     [echo]     maven version: 2.12.0-SNAPSHOT
     [echo]      OSGi version: 2.12.0.v20160329-232805-e5bbc98f78
     [echo] canonical version: 2.12.0-20160329-232805-e5bbc98f78

locker.start:

locker.lib:

locker.reflect:

locker.comp:

locker.done:

quick.start:

quick.lib:

Performant Data LLC

unread,
Mar 30, 2016, 5:59:48 PM3/30/16
to scala-internals
This also fails on HEAD:

$ git pull
remote: Counting objects: 110, done.
remote: Compressing objects: 100% (49/49), done.
remote: Total 110 (delta 49), reused 32 (delta 32), pack-reused 20
Receiving objects: 100% (110/110), 35.98 KiB | 0 bytes/s, done.
Resolving deltas: 100% (49/49), completed with 30 local objects.
From https://github.com/scala/scala
   e5bbc98..4fc7d55  2.12.x     -> upstream/2.12.x
Updating e5bbc98..4fc7d55
Fast-forward
 src/compiler/scala/tools/nsc/backend/jvm/opt/BytecodeUtils.scala                |  5 +++
 src/compiler/scala/tools/nsc/backend/jvm/opt/CallGraph.scala                    |  7 ++--
 src/library/scala/collection/Iterator.scala                                     | 90 +++++++++++++++++++++++----------------------
 src/scaladoc/scala/tools/nsc/doc/html/page/IndexScript.scala                    | 36 +++++++++++-------
 src/scaladoc/scala/tools/nsc/doc/html/resource/lib/index.js                     | 31 +++++++++++++++-
 src/scaladoc/scala/tools/nsc/doc/html/resource/lib/template.css                 |  6 +--
 test/junit/scala/tools/nsc/backend/jvm/opt/BTypesFromClassfileTest.scala        |  7 +++-
 test/junit/scala/tools/nsc/backend/jvm/opt/InlineInfoTest.scala                 |  4 +-
 test/junit/scala/tools/nsc/backend/jvm/opt/InlineWarningTest.scala              |  4 +-
 test/junit/scala/tools/nsc/backend/jvm/opt/InlinerSeparateCompilationTest.scala | 11 ++----
 test/junit/scala/tools/nsc/backend/jvm/opt/InlinerTest.scala                    | 81 +++++++++++++++++++---------------------
 11 files changed, 160 insertions(+), 122 deletions(-)
$ ant clean
Buildfile: .../scala/build.xml

libs.clean:

quick.clean:
   [delete] Deleting directory .../scala/build/quick

clean:

BUILD SUCCESSFUL
Total time: 0 seconds

$ ant
Buildfile: .../scala/build.xml

desired.jars.uptodate:

boot:

init.git:

init:
     [copy] Copying 2 files to .../scala/build/deps/junit
     [copy] Copying 29 files to .../scala/build/deps/pax.exam
     [copy] Copying 1 file to .../scala/build/deps/asm
     [copy] Copying 4 files to .../scala/build/deps/partest
     [copy] Copying 1 file to .../scala/build/deps/repl
     [copy] Copying 3 files to .../scala/build/deps/scaladoc
     [echo] Using Scala 2.12.0-M3-dc9effe for STARR.
     [copy] Copying 5 files to .../scala/build/deps/starr
     [echo]        build time: 30 March 2016, 14:52:24

     [echo]      java version: OpenJDK 64-Bit Server VM 1.8.0_66-internal (1.8)
     [echo]         java args: -Xms1536M -Xmx1536M -Xss1M -XX:+UseParallelGC
     [echo]        javac args:
     [echo]       scalac args: -feature 
     [echo] scalac quick args: -feature 
     [echo]          git date: 20160330-101114
     [echo]          git hash: 4fc7d5517c
     [echo]     maven version: 2.12.0-SNAPSHOT
     [echo]      OSGi version: 2.12.0.v20160330-101114-4fc7d5517c
     [echo] canonical version: 2.12.0-20160330-101114-4fc7d5517c


locker.start:

locker.lib:

locker.reflect:

locker.comp:

locker.done:

quick.start:

quick.lib:
    [mkdir] Created dir: .../scala/build/quick/classes/library
[quick.library] Compiling 579 files to .../scala/build/quick/classes/library
[quick.library] warning: there were 118 deprecation warnings; re-run with -deprecation for details
[quick.library] one warning found
    [javac] Compiling 168 source files to .../scala/build/quick/classes/library

    [javac] .../scala/src/library/scala/runtime/java8/JFunction1.java:8: error: Unexpected @FunctionalInterface annotation
    [javac] @FunctionalInterface
    [javac] ^
    [javac]   JFunction1 is not a functional interface
    [javac]     multiple non-overriding abstract methods found in interface JFunction1
...
    [javac] Note: Some input files use unchecked or unsafe operations.
    [javac] Note: Recompile with -Xlint:unchecked for details.
    [javac] 100 errors

BUILD FAILED
.../scala/build.xml:1081: The following error occurred while executing this line:
.../scala/build-ant-macros.xml:279: The following error occurred while executing this line:
.../scala/build-ant-macros.xml:290: The following error occurred while executing this line:
.../scala/build-ant-macros.xml:134: Compile failed; see the compiler error output for details.

Total time: 1 minute 31 seconds

Adriaan Moors

unread,
Mar 30, 2016, 6:25:05 PM3/30/16
to scala-i...@googlegroups.com
Bizarre. Could you try upgrading your version of java? This is a javac error.

I tried on my machine with a fresh checkout. It built fine using ant 1.9.6 and jdk 1.8.0_74

Here's a transcript running ant -v, which may provide further hints as to differences between our machines.

You could also give the sbt build a shot :-) it's marked as experimental because we haven't switched over to it 100%, but we're using it daily both on CI and dev.

--

Performant Data LLC

unread,
Mar 30, 2016, 7:18:11 PM3/30/16
to scala-internals

Could you try upgrading your version of java? This is a javac error.

1.8.0_72 (what jessie-backports has) gives the same errors.
 
You could also give the sbt build a shot

That works. My benchmark class runs against build-sbt/pack.

Seth Tisue

unread,
Apr 6, 2016, 2:29:08 PM4/6/16
to scala-internals
we had another similar report come in that was resolved by cleaning with `git clean -fdx` rather than relying on either sbt or ant to truly clean everything

iulian dragos

unread,
Apr 12, 2016, 7:05:25 AM4/12/16
to scala-i...@googlegroups.com

I think ant all.clean is usually enough. Probably an old locker compiler, I got bitten by this error as well. I’m on java 1.8.0_u45, so I doubt that javac plays a role.


On Wed, Apr 6, 2016 at 8:29 PM, Seth Tisue <se...@tisue.net> wrote:
we had another similar report come in that was resolved by cleaning with `git clean -fdx` rather than relying on either sbt or ant to truly clean everything

--
You received this message because you are subscribed to the Google Groups "scala-internals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-interna...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
« Je déteste la montagne, ça cache le paysage »
Alphonse Allais

som-snytt

unread,
Apr 14, 2016, 1:42:20 AM4/14/16
to scala-internals

I can understand that Lightbend cannot afford to hand out free t-shirts to contributors, such as the one with Adriaan depicted as Che Guevara, which I would kill for, by the way.

But I don't understand why they don't mete out what must be a stockpile of "ant all.clean!" tees, I mean the ones with "git clean -fdx!" on the back.

Now that the sbt build is usable, those tees will be worth a mint on the secondary scala tee market. Oh wait, I guess Lightbend uses them to incentivize new hires? Lucky them!

Performant Data LLC

unread,
Apr 23, 2016, 6:57:15 PM4/23/16
to scala-internals
On April 12, Iulian Dragos wrote:

I think ant all.clean is usually enough.

That works. I wouldn't use "git clean -fdx", since I have untracked changes.

Performant Data LLC

unread,
Apr 27, 2016, 5:49:26 PM4/27/16
to scala-internals
This error also appears in the Eclipse scala-library project as "Invalid '@FunctionalInterface' annotation; J... is not a functional interface", if you don't point the project's Scala installation to a 2.12.
Reply all
Reply to author
Forward
0 new messages