Thu, 21 Feb 2013 14:43:51 -0800
8008405: Now that metafactory is in place, add javac lambda serialization tests
Summary: Tests part of original langtools serialization review.
Reviewed-by: mcimadamore
mcimadamore@195 | 1 | /* |
jjg@384 | 2 | * @test /nodynamiccopyright/ |
mcimadamore@195 | 3 | * @author Maurizio Cimadamore |
mcimadamore@195 | 4 | * @bug 6795580 |
mcimadamore@195 | 5 | * @summary parser confused by square brackets in qualified generic cast |
mcimadamore@195 | 6 | * @compile/fail/ref=T6795580.out -XDrawDiagnostics T6795580.java |
mcimadamore@195 | 7 | */ |
mcimadamore@195 | 8 | |
mcimadamore@195 | 9 | class T6795580 { |
mcimadamore@195 | 10 | class Outer<S> { |
mcimadamore@195 | 11 | class Inner<T> {} |
mcimadamore@195 | 12 | } |
mcimadamore@195 | 13 | |
mcimadamore@195 | 14 | void cast1(Outer<Integer>.Inner<Long>[] p) { |
mcimadamore@195 | 15 | Object o = (Outer<Integer>.Inner<Long>[])p; |
mcimadamore@195 | 16 | } |
mcimadamore@195 | 17 | |
mcimadamore@195 | 18 | void cast2(Outer<Integer>.Inner<Long>[] p) { |
mcimadamore@195 | 19 | Object o = (Outer<? extends Number>.Inner<Long>[])p; |
mcimadamore@195 | 20 | } |
mcimadamore@195 | 21 | |
mcimadamore@195 | 22 | void cast3(Outer<Integer>.Inner<Long>[] p) { |
mcimadamore@195 | 23 | Object o = (Outer<Integer>.Inner<? extends Number>[])p; |
mcimadamore@195 | 24 | } |
mcimadamore@195 | 25 | |
mcimadamore@195 | 26 | void cast4(Outer<Integer>.Inner<Long>[] p) { |
mcimadamore@195 | 27 | Object o = (Outer<? extends Number>.Inner<? extends Number>[])p; |
mcimadamore@195 | 28 | } |
mcimadamore@195 | 29 | |
mcimadamore@195 | 30 | void cast5(Outer<Integer>.Inner<Long>[] p) { |
mcimadamore@195 | 31 | Object o = (Outer<? super Number>.Inner<Long>[])p; |
mcimadamore@195 | 32 | } |
mcimadamore@195 | 33 | |
mcimadamore@195 | 34 | void cast6(Outer<Integer>.Inner<Long>[] p) { |
mcimadamore@195 | 35 | Object o = (Outer<Integer>.Inner<? super Number>[])p; |
mcimadamore@195 | 36 | } |
mcimadamore@195 | 37 | |
mcimadamore@195 | 38 | void cast7(Outer<Integer>.Inner<Long>[] p) { |
mcimadamore@195 | 39 | Object o = (Outer<? super Number>.Inner<? super Number>[])p; |
mcimadamore@195 | 40 | } |
mcimadamore@195 | 41 | |
mcimadamore@195 | 42 | void cast8(Outer<Integer>.Inner<Long>[] p) { |
mcimadamore@195 | 43 | Object o = (Outer<? extends String>.Inner<Long>[])p; |
mcimadamore@195 | 44 | } |
mcimadamore@195 | 45 | |
mcimadamore@195 | 46 | void cast9(Outer<Integer>.Inner<Long>[] p) { |
mcimadamore@195 | 47 | Object o = (Outer<Integer>.Inner<? extends String>[])p; |
mcimadamore@195 | 48 | } |
mcimadamore@195 | 49 | |
mcimadamore@195 | 50 | void cast10(Outer<Integer>.Inner<Long>[] p) { |
mcimadamore@195 | 51 | Object o = (Outer<? super String>.Inner<Long>[])p; |
mcimadamore@195 | 52 | } |
mcimadamore@195 | 53 | |
mcimadamore@195 | 54 | void cast11(Outer<Integer>.Inner<Long>[] p) { |
mcimadamore@195 | 55 | Object o = (Outer<Integer>.Inner<? super String>[])p; |
mcimadamore@195 | 56 | } |
jjg@384 | 57 | } |