1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/test/tools/javac/lambda/TargetType17.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 javac recovers succesfully from bad cast conversion to primitive type 1.9 + * @compile/fail/ref=TargetType17.out -XDrawDiagnostics TargetType17.java 1.10 + */ 1.11 + 1.12 +class TargetType17 { 1.13 + interface SAM<X> { 1.14 + boolean m(X x); 1.15 + } 1.16 + 1.17 + byte b = (byte) ()-> true; 1.18 + short s = (short) ()-> 1; 1.19 + int i = (int) ()-> 1; 1.20 + long l = (long) ()-> 1L; 1.21 + float f = (float) ()-> 1.0F; 1.22 + double d = (double) ()-> 1.0; 1.23 + char c = (char) ()-> 'c'; 1.24 + boolean z = (boolean) ()-> true; 1.25 +}