-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
Description
Dotty fails to process @FunctionalInterface
objects when they contain overridden public methods of java.lang.Object
, but javadoc states:
If an interface declares an abstract method overriding one of the public methods of java.lang.Object, that also does not count toward the interface's abstract method count
minimized code
val comp : java.util.Comparator[Int] = (x, y) => -1
println(comp.compare(1,2))
fails with
-- [E081] Syntax Error: MySam.scala:10:46 --------------------------------------
10 | val comp : java.util.Comparator[Int] = (x, y) => -1
| ^
| Missing parameter type
|
| I could not infer the type of the parameter x.
-- [E081] Syntax Error: MySam.scala:10:49 --------------------------------------
10 | val comp : java.util.Comparator[Int] = (x, y) => -1
| ^
| Missing parameter type
|
| I could not infer the type of the parameter y.
two errors found
expectation
The code above should print -1 to the standard output.