Eclipse Java Compiler cannot compile calls to some Scala-defined methods — help needed


There is a bug in Eclipse Java Compiler:
Bug 468276 -
[1.8][compiler] JDT compiler reporting ambiguous method, but code compiles fine with Oracle JDK

Can sameone help with solving this bug? Any tips will be helpful, especially for this:

“Till today I haven’t found a compelling strategy to accommodate the Scala type system in a Java compiler. Perhaps people with inside knowledge of Scala type checking can propose an algorithm to detect when method ambiguity is not “real” because of extra safety provided by Scala typing rules.”

Best regards,

I fixed the title to point out why this post might somehow be relevant.
Apparently, the Eclipse compiler currently assumes that the classes it links against are not just legal bytecode but are produced by legal Java, and sometimes Scala classes go beyond what’s possible in Java, confusing it.

(For the record, the old title was ‘Eclipse Java Compiler reports error when compiling to Java 8: “The method XXX is ambiguous for the type YYY” - help needed’).

1 Like