Mon, 24 Oct 2011 13:00:30 +0100
7098660: Write better overload resolution/inference tests
Summary: Add overload/inference debug diagnostics - added test harness using annotations to check outcome of overload resolution/inference
Reviewed-by: jjg
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 }