1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/test/tools/javac/lambda/TargetType39.java Wed Apr 27 01:34:52 2016 +0800 1.3 @@ -0,0 +1,22 @@ 1.4 +/* 1.5 + * @test /nodynamiccopyright/ 1.6 + * @bug 8003280 1.7 + * @summary Add lambda tests 1.8 + * check that type-checking fails because of recursive analysis of stuck expressions 1.9 + * @compile/fail/ref=TargetType39.out -XDrawDiagnostics TargetType39.java 1.10 + */ 1.11 +class TargetType39 { 1.12 + 1.13 + interface I { } 1.14 + 1.15 + interface SAM<A, R> { 1.16 + R m(A a); 1.17 + } 1.18 + 1.19 + <U, V> void call(SAM<U, V> s) { } 1.20 + 1.21 + void test(boolean cond, SAM<String, Void> ssv) { 1.22 + call(cond ? x-> null : ssv); 1.23 + call((String s)-> cond ? x-> null : ssv); 1.24 + } 1.25 +}