langtools/test/tools/javac/generics/rare/6665356/T6665356.java
author jjg
Thu, 27 Aug 2009 11:08:27 -0700
changeset 3766 7e2df99e9223
parent 2212 1d3dc0e0ba0c
permissions -rw-r--r--
6875336: some tests should use /nodynamiccopyright/ Reviewed-by: darcy
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1790
7182011ee8a6 6665356: Cast not allowed when both qualifying type and inner class are parameterized
mcimadamore
parents:
diff changeset
     1
/*
3766
7e2df99e9223 6875336: some tests should use /nodynamiccopyright/
jjg
parents: 2212
diff changeset
     2
 * @test /nodynamiccopyright/
1790
7182011ee8a6 6665356: Cast not allowed when both qualifying type and inner class are parameterized
mcimadamore
parents:
diff changeset
     3
 * @author Maurizio Cimadamore
7182011ee8a6 6665356: Cast not allowed when both qualifying type and inner class are parameterized
mcimadamore
parents:
diff changeset
     4
 * @bug     6665356
7182011ee8a6 6665356: Cast not allowed when both qualifying type and inner class are parameterized
mcimadamore
parents:
diff changeset
     5
 * @summary Cast not allowed when both qualifying type and inner class are parameterized
7182011ee8a6 6665356: Cast not allowed when both qualifying type and inner class are parameterized
mcimadamore
parents:
diff changeset
     6
 * @compile/fail/ref=T6665356.out -XDrawDiagnostics T6665356.java
7182011ee8a6 6665356: Cast not allowed when both qualifying type and inner class are parameterized
mcimadamore
parents:
diff changeset
     7
 */
7182011ee8a6 6665356: Cast not allowed when both qualifying type and inner class are parameterized
mcimadamore
parents:
diff changeset
     8
7182011ee8a6 6665356: Cast not allowed when both qualifying type and inner class are parameterized
mcimadamore
parents:
diff changeset
     9
class T6665356 {
7182011ee8a6 6665356: Cast not allowed when both qualifying type and inner class are parameterized
mcimadamore
parents:
diff changeset
    10
    class Outer<S> {
7182011ee8a6 6665356: Cast not allowed when both qualifying type and inner class are parameterized
mcimadamore
parents:
diff changeset
    11
        class Inner<T> {}
7182011ee8a6 6665356: Cast not allowed when both qualifying type and inner class are parameterized
mcimadamore
parents:
diff changeset
    12
    }
7182011ee8a6 6665356: Cast not allowed when both qualifying type and inner class are parameterized
mcimadamore
parents:
diff changeset
    13
7182011ee8a6 6665356: Cast not allowed when both qualifying type and inner class are parameterized
mcimadamore
parents:
diff changeset
    14
    void test1() {
7182011ee8a6 6665356: Cast not allowed when both qualifying type and inner class are parameterized
mcimadamore
parents:
diff changeset
    15
        boolean b;
7182011ee8a6 6665356: Cast not allowed when both qualifying type and inner class are parameterized
mcimadamore
parents:
diff changeset
    16
        b = null instanceof Outer.Inner;
7182011ee8a6 6665356: Cast not allowed when both qualifying type and inner class are parameterized
mcimadamore
parents:
diff changeset
    17
        b = null instanceof Outer<?>.Inner;
7182011ee8a6 6665356: Cast not allowed when both qualifying type and inner class are parameterized
mcimadamore
parents:
diff changeset
    18
        b = null instanceof Outer.Inner<?>;
7182011ee8a6 6665356: Cast not allowed when both qualifying type and inner class are parameterized
mcimadamore
parents:
diff changeset
    19
        b = null instanceof Outer<?>.Inner<?>;
7182011ee8a6 6665356: Cast not allowed when both qualifying type and inner class are parameterized
mcimadamore
parents:
diff changeset
    20
    }
7182011ee8a6 6665356: Cast not allowed when both qualifying type and inner class are parameterized
mcimadamore
parents:
diff changeset
    21
7182011ee8a6 6665356: Cast not allowed when both qualifying type and inner class are parameterized
mcimadamore
parents:
diff changeset
    22
    void test2() {
7182011ee8a6 6665356: Cast not allowed when both qualifying type and inner class are parameterized
mcimadamore
parents:
diff changeset
    23
        boolean b;
7182011ee8a6 6665356: Cast not allowed when both qualifying type and inner class are parameterized
mcimadamore
parents:
diff changeset
    24
        Object o;
7182011ee8a6 6665356: Cast not allowed when both qualifying type and inner class are parameterized
mcimadamore
parents:
diff changeset
    25
        o = (Outer.Inner)null;
7182011ee8a6 6665356: Cast not allowed when both qualifying type and inner class are parameterized
mcimadamore
parents:
diff changeset
    26
        o = (Outer<?>.Inner)null;
7182011ee8a6 6665356: Cast not allowed when both qualifying type and inner class are parameterized
mcimadamore
parents:
diff changeset
    27
        o = (Outer.Inner<?>)null;
7182011ee8a6 6665356: Cast not allowed when both qualifying type and inner class are parameterized
mcimadamore
parents:
diff changeset
    28
        o = (Outer<?>.Inner<?>)null;
7182011ee8a6 6665356: Cast not allowed when both qualifying type and inner class are parameterized
mcimadamore
parents:
diff changeset
    29
    }
3766
7e2df99e9223 6875336: some tests should use /nodynamiccopyright/
jjg
parents: 2212
diff changeset
    30
}