diff -r 000000000000 -r 959103a6100f test/tools/javac/lambda/TargetType44.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/lambda/TargetType44.java Wed Apr 27 01:34:52 2016 +0800 @@ -0,0 +1,27 @@ +/* + * @test /nodynamiccopyright/ + * @bug 8003280 + * @summary Add lambda tests + * compiler throw AssertionError while backtracing from speculative attribution round + * @compile/fail/ref=TargetType44.out -XDrawDiagnostics TargetType44.java + */ +class TargetType44 { + + interface Unary { + void m(int i1); + } + + interface Binary { + void m(int i1, int i2); + } + + void m(Unary u) { } + void m(Binary u) { } + + void test() { + m(()-> { new Object() { }; }); //fail + m(x -> { new Object() { }; }); //ok + m((x, y) -> { new Object() { }; }); //ok + m((x, y, z) -> { new Object() { }; }); //fail + } +}