diff -r 000000000000 -r 959103a6100f test/tools/javac/lambda/TargetType33.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/lambda/TargetType33.java Wed Apr 27 01:34:52 2016 +0800 @@ -0,0 +1,25 @@ +/* + * @test /nodynamiccopyright/ + * @bug 8003280 + * @summary Add lambda tests + * crash when incompatible method reference is found in conditional expression + * @compile/fail/ref=TargetType33.out -XDrawDiagnostics TargetType33.java + */ + +class TargetType33 { + + interface A { + X m(); + } + + void m(A a) { } + void m2(A a) { } + + int intRes(Object o) { return 42; } + + void testMethodRef(boolean flag) { + A c = flag ? this::intRes : this::intRes; + m(flag ? this::intRes : this::intRes); + m2(flag ? this::intRes : this::intRes); + } +}