Mon, 24 Jan 2011 15:44:51 +0000
6968793: issues with diagnostics
Summary: several diagnostic improvements
Reviewed-by: jjg
mcimadamore@537 | 1 | /* |
mcimadamore@537 | 2 | * @test /nodynamiccopyright/ |
mcimadamore@537 | 3 | * @bug 6939620 |
mcimadamore@537 | 4 | * |
mcimadamore@537 | 5 | * @summary Switch to 'complex' diamond inference scheme |
mcimadamore@537 | 6 | * @author mcimadamore |
mcimadamore@537 | 7 | * @compile/fail/ref=Neg01.out Neg01.java -XDrawDiagnostics |
mcimadamore@537 | 8 | * |
mcimadamore@537 | 9 | */ |
mcimadamore@537 | 10 | |
mcimadamore@537 | 11 | class Neg01<X extends Number> { |
mcimadamore@537 | 12 | |
mcimadamore@537 | 13 | Neg01(X x) {} |
mcimadamore@537 | 14 | |
mcimadamore@537 | 15 | <Z> Neg01(X x, Z z) {} |
mcimadamore@537 | 16 | |
mcimadamore@537 | 17 | void test() { |
mcimadamore@537 | 18 | Neg01<String> n1 = new Neg01<>(""); |
mcimadamore@537 | 19 | Neg01<? extends String> n2 = new Neg01<>(""); |
mcimadamore@537 | 20 | Neg01<?> n3 = new Neg01<>(""); |
mcimadamore@537 | 21 | Neg01<? super String> n4 = new Neg01<>(""); |
mcimadamore@537 | 22 | |
mcimadamore@537 | 23 | Neg01<String> n5 = new Neg01<>(""){}; |
mcimadamore@537 | 24 | Neg01<? extends String> n6 = new Neg01<>(""){}; |
mcimadamore@537 | 25 | Neg01<?> n7 = new Neg01<>(""){}; |
mcimadamore@537 | 26 | Neg01<? super String> n8 = new Neg01<>(""){}; |
mcimadamore@537 | 27 | |
mcimadamore@537 | 28 | Neg01<String> n9 = new Neg01<>("", ""); |
mcimadamore@537 | 29 | Neg01<? extends String> n10 = new Neg01<>("", ""); |
mcimadamore@537 | 30 | Neg01<?> n11 = new Neg01<>("", ""); |
mcimadamore@537 | 31 | Foo<? super String> n12 = new Neg01<>("", ""); |
mcimadamore@537 | 32 | |
mcimadamore@537 | 33 | Neg01<String> n13 = new Neg01<>("", ""){}; |
mcimadamore@537 | 34 | Neg01<? extends String> n14 = new Neg01<>("", ""){}; |
mcimadamore@537 | 35 | Neg01<?> n15 = new Neg01<>("", ""){}; |
mcimadamore@537 | 36 | Neg01<? super String> n16 = new Neg01<>("", ""){}; |
mcimadamore@537 | 37 | } |
mcimadamore@537 | 38 | } |