Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/exceptions/NotThrownLambdaBodyReferencedMethod.java
anna 481bc252f3 switch tests on new inference
(cherry picked from commit d2cbf3f2833104c3a0381059b0d6ef8ac0b3c94c)
2013-11-25 16:47:38 +01:00

22 lines
507 B
Java

import java.io.IOException;
class Test {
interface F<T extends Throwable> {
void _() throws T;
}
void m1() { }
void m2() throws NullPointerException{ }
void m3() throws IOException { }
<K extends Throwable> void foo(F<K> f) throws K { }
{
foo(()->{});
foo(()->{throw new NullPointerException();});
foo(this::m1);
foo(this::m2);
<error descr="Unhandled exception: java.io.IOException">foo(this::m3);</error>
}
}