test/tools/javac/lambda/TargetType17.java

Thu, 21 Feb 2013 15:27:05 +0000

author
mcimadamore
date
Thu, 21 Feb 2013 15:27:05 +0000
changeset 1600
3fef0cae83b3
parent 0
959103a6100f
permissions
-rw-r--r--

8008444: Inherited generic functional descriptors are merged incorrectly
Summary: Missing call to Types.createMethodWithThrownTypes
Reviewed-by: jjg

aoqi@0 1 /*
aoqi@0 2 * @test /nodynamiccopyright/
aoqi@0 3 * @bug 8003280
aoqi@0 4 * @summary Add lambda tests
aoqi@0 5 * check that javac recovers succesfully from bad cast conversion to primitive type
aoqi@0 6 * @compile/fail/ref=TargetType17.out -XDrawDiagnostics TargetType17.java
aoqi@0 7 */
aoqi@0 8
aoqi@0 9 class TargetType17 {
aoqi@0 10 interface SAM<X> {
aoqi@0 11 boolean m(X x);
aoqi@0 12 }
aoqi@0 13
aoqi@0 14 byte b = (byte) ()-> true;
aoqi@0 15 short s = (short) ()-> 1;
aoqi@0 16 int i = (int) ()-> 1;
aoqi@0 17 long l = (long) ()-> 1L;
aoqi@0 18 float f = (float) ()-> 1.0F;
aoqi@0 19 double d = (double) ()-> 1.0;
aoqi@0 20 char c = (char) ()-> 'c';
aoqi@0 21 boolean z = (boolean) ()-> true;
aoqi@0 22 }

mercurial