test/tools/javac/cast/6467183/T6467183a.java

Fri, 02 Nov 2012 14:35:57 -0700

author
jjg
date
Fri, 02 Nov 2012 14:35:57 -0700
changeset 1386
bf76f4190ef8
parent 384
ed31953ca025
child 2525
2eb010b6cb22
permissions
-rw-r--r--

7169362: JDK8: Write compiler tests for repeating annotations for JDK8
Reviewed-by: darcy, jjg
Contributed-by: sonali.goel@oracle.com

     1 /*
     2  * @test /nodynamiccopyright/
     3  * @author mcimadamore
     4  * @bug     6467183
     5  * @summary
     6  * @compile/fail/ref=T6467183a.out -Xlint:unchecked -Werror -XDrawDiagnostics T6467183a.java
     7  */
     9 class T6467183a<T> {
    11     class A<S> {}
    12     class B extends A<Integer> {}
    13     class C<X> extends A<X> {}
    15     void cast1(B b) {
    16         Object o = (A<T>)b;
    17     }
    19     void cast2(B b) {
    20         Object o = (A<? extends Number>)b;
    21     }
    23     void cast3(A<Integer> a) {
    24         Object o = (C<? extends Number>)a;
    25     }
    27     void cast4(A<Integer> a) {
    28         Object o = (C<? extends Integer>)a;
    29     }
    30 }

mercurial