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
mcimadamore@211 | 1 | /* |
jjg@384 | 2 | * @test /nodynamiccopyright/ |
mcimadamore@211 | 3 | * @author Maurizio Cimadamore |
mcimadamore@211 | 4 | * @bug 6557182 |
mcimadamore@211 | 5 | * @summary Unchecked warning *and* inconvertible types |
mcimadamore@211 | 6 | * @compile/fail/ref=T6557182.out -XDrawDiagnostics -Xlint:unchecked T6557182.java |
mcimadamore@211 | 7 | */ |
mcimadamore@211 | 8 | |
mcimadamore@211 | 9 | class T6557182 { |
mcimadamore@211 | 10 | |
mcimadamore@211 | 11 | <T extends Number & Comparable<String>> void test1(T t) { |
mcimadamore@211 | 12 | Comparable<Integer> ci = (Comparable<Integer>) t; |
mcimadamore@211 | 13 | } |
mcimadamore@211 | 14 | |
mcimadamore@211 | 15 | <T extends Number & Comparable<? extends Number>> void test2(T t) { |
mcimadamore@211 | 16 | Comparable<Integer> ci = (Comparable<Integer>) t; |
mcimadamore@211 | 17 | } |
mcimadamore@211 | 18 | } |