test/tools/javac/cast/6665356/T6665356.java

Mon, 23 Sep 2013 17:27:38 +0400

author
kizune
date
Mon, 23 Sep 2013 17:27:38 +0400
changeset 2048
809a50f24d6f
parent 384
ed31953ca025
child 2525
2eb010b6cb22
permissions
-rw-r--r--

7154966: CRs found to be in Fixed state with no test and no noreg- keyword.
Reviewed-by: ksrini

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 cast1(Outer<Integer>.Inner<Long> p) {
mcimadamore@185 15 Object o = (Outer<Integer>.Inner<Long>)p;
mcimadamore@185 16 }
mcimadamore@185 17
mcimadamore@185 18 void cast2(Outer<Integer>.Inner<Long> p) {
mcimadamore@185 19 Object o = (Outer<? extends Number>.Inner<Long>)p;
mcimadamore@185 20 }
mcimadamore@185 21
mcimadamore@185 22 void cast3(Outer<Integer>.Inner<Long> p) {
mcimadamore@185 23 Object o = (Outer<Integer>.Inner<? extends Number>)p;
mcimadamore@185 24 }
mcimadamore@185 25
mcimadamore@185 26 void cast4(Outer<Integer>.Inner<Long> p) {
mcimadamore@185 27 Object o = (Outer<? extends Number>.Inner<? extends Number>)p;
mcimadamore@185 28 }
mcimadamore@185 29
mcimadamore@185 30 void cast5(Outer<Integer>.Inner<Long> p) {
mcimadamore@185 31 Object o = (Outer<? super Number>.Inner<Long>)p;
mcimadamore@185 32 }
mcimadamore@185 33
mcimadamore@185 34 void cast6(Outer<Integer>.Inner<Long> p) {
mcimadamore@185 35 Object o = (Outer<Integer>.Inner<? super Number>)p;
mcimadamore@185 36 }
mcimadamore@185 37
mcimadamore@185 38 void cast7(Outer<Integer>.Inner<Long> p) {
mcimadamore@185 39 Object o = (Outer<? super Number>.Inner<? super Number>)p;
mcimadamore@185 40 }
mcimadamore@185 41
mcimadamore@185 42 void cast8(Outer<Integer>.Inner<Long> p) {
mcimadamore@185 43 Object o = (Outer<? extends String>.Inner<Long>)p;
mcimadamore@185 44 }
mcimadamore@185 45
mcimadamore@185 46 void cast9(Outer<Integer>.Inner<Long> p) {
mcimadamore@185 47 Object o = (Outer<Integer>.Inner<? extends String>)p;
mcimadamore@185 48 }
mcimadamore@185 49
mcimadamore@185 50 void cast10(Outer<Integer>.Inner<Long> p) {
mcimadamore@185 51 Object o = (Outer<? super String>.Inner<Long>)p;
mcimadamore@185 52 }
mcimadamore@185 53
mcimadamore@185 54 void cast11(Outer<Integer>.Inner<Long> p) {
mcimadamore@185 55 Object o = (Outer<Integer>.Inner<? super String>)p;
mcimadamore@185 56 }
jjg@384 57 }

mercurial