Mon, 21 Jan 2013 20:13:56 +0000
8005244: Implement overload resolution as per latest spec EDR
Summary: Add support for stuck expressions and provisional applicability
Reviewed-by: jjg
1 /*
2 * @test /nodynamiccopyright/
3 * @bug 6939620 7020044
4 *
5 * @summary Check that diamond fails when inference violates declared bounds
6 * (basic test with nested class, generic/non-generic constructors)
7 * @author mcimadamore
8 * @compile/fail/ref=Neg01.out Neg01.java -XDrawDiagnostics
9 *
10 */
12 class Neg01<X extends Number> {
14 Neg01(X x) {}
16 <Z> Neg01(X x, Z z) {}
18 void test() {
19 Neg01<String> n1 = new Neg01<>("");
20 Neg01<? extends String> n2 = new Neg01<>("");
21 Neg01<?> n3 = new Neg01<>("");
22 Neg01<? super String> n4 = new Neg01<>("");
24 Neg01<String> n5 = new Neg01<>("", "");
25 Neg01<? extends String> n6 = new Neg01<>("", "");
26 Neg01<?> n7 = new Neg01<>("", "");
27 Foo<? super String> n8 = new Neg01<>("", "");
28 }
29 }