test/tools/javac/generics/diamond/neg/Neg08.java

changeset 537
9d9d08922405
child 914
ca32f2986301
equal deleted inserted replaced
536:396b117c1743 537:9d9d08922405
1 /*
2 * @test /nodynamiccopyright/
3 * @bug 6939620 6894753
4 *
5 * @summary Switch to 'complex' diamond inference scheme
6 * @author mcimadamore
7 * @compile/fail/ref=Neg08.out Neg08.java -XDrawDiagnostics
8 *
9 */
10
11 class Neg08 {
12 static class Foo<X> {
13 Foo(X x) { }
14 }
15
16 static class DoubleFoo<X,Y> {
17 DoubleFoo(X x,Y y) { }
18 }
19
20 static class TripleFoo<X,Y,Z> {
21 TripleFoo(X x,Y y,Z z) { }
22 }
23
24 Foo<? extends Integer> fi = new Foo<>(1);
25 Foo<?> fw = new Foo<>(fi);
26 Foo<? extends Double> fd = new Foo<>(3.0);
27 DoubleFoo<?,?> dw = new DoubleFoo<>(fi,fd);
28 Foo<String> fs = new Foo<>("one");
29 TripleFoo<?,?,?> tw = new TripleFoo<>(fi,fd,fs);
30 }

mercurial