|
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 */ |
|
8 |
|
9 class T6467183a<T> { |
|
10 |
|
11 class A<S> {} |
|
12 class B extends A<Integer> {} |
|
13 class C<X> extends A<X> {} |
|
14 |
|
15 void cast1(B b) { |
|
16 Object o = (A<T>)b; |
|
17 } |
|
18 |
|
19 void cast2(B b) { |
|
20 Object o = (A<? extends Number>)b; |
|
21 } |
|
22 |
|
23 void cast3(A<Integer> a) { |
|
24 Object o = (C<? extends Number>)a; |
|
25 } |
|
26 |
|
27 void cast4(A<Integer> a) { |
|
28 Object o = (C<? extends Integer>)a; |
|
29 } |
|
30 } |