Community
Participate
Working Groups
Created attachment 256265 [details] Source code demonstrating bug I get a compiler error from ajc 1.8.6 when I try to compile a Java class making use of lambda functions: ajc: Type mismatch: cannot convert from Object to boolean The code that triggers this error is below. Note that this compiles with the Oracle JDK 1.8.0_60 compiler. import java.util.Optional; public class Testing { public static void main(String[] args) { Optional<Integer> value1 = Optional.of(15); Optional<Integer> value2 = Optional.of(30); boolean passed = value1.flatMap(v1 -> value2.map(v2 -> (v2 / v1) == 2)).orElse(false); System.out.println(passed); } }
Have you tried with an AspectJ 1.8.7 dev build? (the snapshot build on https://www.eclipse.org/aspectj/downloads.php) compiles that code fine (whilst 1.8.6 does not) - so I think it is already fixed.
I added the sample code here as a testcase, it is definitely passing in 1.8.7.