diff -r 000000000000 -r 959103a6100f test/tools/javac/lambda/TargetType17.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/lambda/TargetType17.java Wed Apr 27 01:34:52 2016 +0800 @@ -0,0 +1,22 @@ +/* + * @test /nodynamiccopyright/ + * @bug 8003280 + * @summary Add lambda tests + * check that javac recovers succesfully from bad cast conversion to primitive type + * @compile/fail/ref=TargetType17.out -XDrawDiagnostics TargetType17.java + */ + +class TargetType17 { + interface SAM { + boolean m(X x); + } + + byte b = (byte) ()-> true; + short s = (short) ()-> 1; + int i = (int) ()-> 1; + long l = (long) ()-> 1L; + float f = (float) ()-> 1.0F; + double d = (double) ()-> 1.0; + char c = (char) ()-> 'c'; + boolean z = (boolean) ()-> true; +}