diff -r 000000000000 -r 959103a6100f test/tools/javac/lambda/TargetType28.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/lambda/TargetType28.java Wed Apr 27 01:34:52 2016 +0800 @@ -0,0 +1,23 @@ +/* + * @test /nodynamiccopyright/ + * @bug 8003280 + * @summary Add lambda tests + * target type inference in a case where lambda expression returns diamond + * @compile/fail/ref=TargetType28.out -XDrawDiagnostics TargetType28.java + */ + +class TargetType28 { + static class SuperFoo {} + + static class Foo extends SuperFoo {} + + interface A { + SuperFoo m(X x); + } + + SuperFoo apply(A ax, Z x) { return null; } + + SuperFoo ls = apply(x-> new Foo<>(), 1); + SuperFoo li = apply(x-> new Foo<>(), 1); + SuperFoo lw = apply(x-> new Foo<>(), 1); +}