Fri, 02 Nov 2012 14:35:57 -0700
7169362: JDK8: Write compiler tests for repeating annotations for JDK8
Reviewed-by: darcy, jjg
Contributed-by: sonali.goel@oracle.com
1 /*
2 * @test /nodynamiccopyright/
3 * @bug 6939780 7020044
4 *
5 * @summary add a warning to detect diamond sites
6 * @author mcimadamore
7 * @compile/ref=T6939780.out T6939780.java -XDrawDiagnostics -XDfindDiamond
8 *
9 */
11 class T6939780 {
13 void test() {
14 class Foo<X extends Number> {
15 Foo() {}
16 Foo(X x) {}
17 }
18 Foo<Number> f1 = new Foo<Number>(1);
19 Foo<?> f2 = new Foo<Number>();
20 Foo<?> f3 = new Foo<Integer>();
21 Foo<Number> f4 = new Foo<Number>(1) {};
22 Foo<?> f5 = new Foo<Number>() {};
23 Foo<?> f6 = new Foo<Integer>() {};
24 }
25 }