Error in uncaught exception checking for lambda expressions
Issue #308
new
ExtendJ 8.1.2-15-gd4d25af7 Java SE 8
ExtendJ incorrectly reports an error about an unhandled exception type for the following test case:
// .result: COMPILE_PASS public class Test { void m() throws Exception { doExceptionally(() -> f()); } void f() throws Exception { } <E extends Throwable> void doExceptionally(ExceptionalListener<E> fun) throws E { fun.apply(); } } interface ExceptionalListener<E extends Throwable> { void apply() throws E; }
Expected result: should compile without error
Actual result: ExtendJ prints the following error message:
tests/jsr335/lambda/exception_ti_01p/Test.java:4: error: Test.doExceptionally invoked in Test may throw uncaught exception java.lang.Throwable
Comments (1)
-
reporter - Log in to comment
See the comments at the end of JLS8 §18.2.5: