test/tools/javac/generics/rare/6665356/T6665356.java

Mon, 28 Nov 2011 15:56:42 +0000

author
mcimadamore
date
Mon, 28 Nov 2011 15:56:42 +0000
changeset 1144
9448fe783fd2
parent 384
ed31953ca025
child 2525
2eb010b6cb22
permissions
-rw-r--r--

7115050: Add parser support for lambda expressions
Summary: Add support for parsing lambda expressions to JavacParser
Reviewed-by: jjg

mcimadamore@185 1 /*
jjg@384 2 * @test /nodynamiccopyright/
mcimadamore@185 3 * @author Maurizio Cimadamore
mcimadamore@185 4 * @bug 6665356
mcimadamore@185 5 * @summary Cast not allowed when both qualifying type and inner class are parameterized
mcimadamore@185 6 * @compile/fail/ref=T6665356.out -XDrawDiagnostics T6665356.java
mcimadamore@185 7 */
mcimadamore@185 8
mcimadamore@185 9 class T6665356 {
mcimadamore@185 10 class Outer<S> {
mcimadamore@185 11 class Inner<T> {}
mcimadamore@185 12 }
mcimadamore@185 13
mcimadamore@185 14 void test1() {
mcimadamore@185 15 boolean b;
mcimadamore@185 16 b = null instanceof Outer.Inner;
mcimadamore@185 17 b = null instanceof Outer<?>.Inner;
mcimadamore@185 18 b = null instanceof Outer.Inner<?>;
mcimadamore@185 19 b = null instanceof Outer<?>.Inner<?>;
mcimadamore@185 20 }
mcimadamore@185 21
mcimadamore@185 22 void test2() {
mcimadamore@185 23 boolean b;
mcimadamore@185 24 Object o;
mcimadamore@185 25 o = (Outer.Inner)null;
mcimadamore@185 26 o = (Outer<?>.Inner)null;
mcimadamore@185 27 o = (Outer.Inner<?>)null;
mcimadamore@185 28 o = (Outer<?>.Inner<?>)null;
mcimadamore@185 29 }
jjg@384 30 }

mercurial