score:1

Accepted answer

this was a bug in eclipse which has been fixed for milestone 6 towards eclipse neon (4.6).

score:0

well, it seems like an eclipse compiler bug probably, because it does not compile under javac. i wonder how to fix this or if there is already an issue opened for this.

   multiplecastsbound.java:5: error: incompatible types: int#1 is not a functional interface
        calculator test = (calculator & sumator) (a, b) -> a + b;
                                                 ^
    multiple non-overriding abstract methods found in interface int#1
  where int#1 is an intersection type:
    int#1 extends object,calculator,sumator
multiplecastsbound.java:8: error: incompatible types: int#1 is not a functional interface
        sumator sumator = (calculator & sumator) (a, b) -> a + b;
                                                 ^
    multiple non-overriding abstract methods found in interface int#1
  where int#1 is an intersection type:
    int#1 extends object,calculator,sumator
2 errors

Related Query

More Query from same tag