|
1 /* |
|
2 * @test /nodynamiccopyright/ |
|
3 * @bug 6939780 |
|
4 * |
|
5 * @summary add a warning to detect diamond sites |
|
6 * @author mcimadamore |
|
7 * @compile/ref=T6939780.out T6939780.java -XDrawDiagnostics -XDfindDiamond |
|
8 * |
|
9 */ |
|
10 |
|
11 class T6939780 { |
|
12 |
|
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 } |