1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/test/tools/javac/lambda/TargetType13.java Wed Apr 27 01:34:52 2016 +0800 1.3 @@ -0,0 +1,21 @@ 1.4 +/* 1.5 + * @test /nodynamiccopyright/ 1.6 + * @bug 8003280 1.7 + * @summary Add lambda tests 1.8 + * failure to infer exception thrown types from lambda body causes checked exception to be skipped 1.9 + * @author Maurizio Cimadamore 1.10 + * @compile/fail/ref=TargetType13.out -XDlambdaInferenceDiags=false -XDrawDiagnostics TargetType13.java 1.11 + */ 1.12 + 1.13 +class TargetType13 { 1.14 + 1.15 + interface SAM<E extends Throwable> { 1.16 + void m(Integer x) throws E; 1.17 + } 1.18 + 1.19 + static <E extends Throwable> void call(SAM<E> s) throws E { } 1.20 + 1.21 + void test() { 1.22 + call(i -> { if (i == 2) throw new Exception(); return; }); 1.23 + } 1.24 +}