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
1 /*
2 * @test /nodynamiccopyright/
3 * @author Maurizio Cimadamore
4 * @bug 6795580
5 * @summary parser confused by square brackets in qualified generic cast
6 * @compile/fail/ref=T6795580.out -XDrawDiagnostics T6795580.java
7 */
9 class T6795580 {
10 class Outer<S> {
11 class Inner<T> {}
12 }
14 void cast1(Outer<Integer>.Inner<Long>[] p) {
15 Object o = (Outer<Integer>.Inner<Long>[])p;
16 }
18 void cast2(Outer<Integer>.Inner<Long>[] p) {
19 Object o = (Outer<? extends Number>.Inner<Long>[])p;
20 }
22 void cast3(Outer<Integer>.Inner<Long>[] p) {
23 Object o = (Outer<Integer>.Inner<? extends Number>[])p;
24 }
26 void cast4(Outer<Integer>.Inner<Long>[] p) {
27 Object o = (Outer<? extends Number>.Inner<? extends Number>[])p;
28 }
30 void cast5(Outer<Integer>.Inner<Long>[] p) {
31 Object o = (Outer<? super Number>.Inner<Long>[])p;
32 }
34 void cast6(Outer<Integer>.Inner<Long>[] p) {
35 Object o = (Outer<Integer>.Inner<? super Number>[])p;
36 }
38 void cast7(Outer<Integer>.Inner<Long>[] p) {
39 Object o = (Outer<? super Number>.Inner<? super Number>[])p;
40 }
42 void cast8(Outer<Integer>.Inner<Long>[] p) {
43 Object o = (Outer<? extends String>.Inner<Long>[])p;
44 }
46 void cast9(Outer<Integer>.Inner<Long>[] p) {
47 Object o = (Outer<Integer>.Inner<? extends String>[])p;
48 }
50 void cast10(Outer<Integer>.Inner<Long>[] p) {
51 Object o = (Outer<? super String>.Inner<Long>[])p;
52 }
54 void cast11(Outer<Integer>.Inner<Long>[] p) {
55 Object o = (Outer<Integer>.Inner<? super String>[])p;
56 }
57 }