|
1 /* |
|
2 * @test /nodynamiccopyright/ |
|
3 * @bug 6843077 8006775 |
|
4 * @summary test invalid location of TypeUse |
|
5 * @author Mahmood Ali |
|
6 * @compile/fail/ref=Constructor.out -XDrawDiagnostics Constructor.java |
|
7 */ |
|
8 |
|
9 import java.lang.annotation.Target; |
|
10 import java.lang.annotation.ElementType; |
|
11 |
|
12 class Constructor { |
|
13 // Constructor result type use annotation |
|
14 @A Constructor() { } |
|
15 |
|
16 // Not type parameter annotation |
|
17 @B Constructor(int x) { } |
|
18 |
|
19 // TODO add err: no "this" receiver parameter for constructors |
|
20 // Constructor(@A Constructor this, Object o) { } |
|
21 |
|
22 // TODO: support Outer.this. |
|
23 } |
|
24 |
|
25 class Constructor2 { |
|
26 class Inner { |
|
27 // OK |
|
28 @A Inner() { } |
|
29 } |
|
30 } |
|
31 |
|
32 @Target(ElementType.TYPE_USE) |
|
33 @interface A { } |
|
34 |
|
35 @Target(ElementType.TYPE_PARAMETER) |
|
36 @interface B { } |
|
37 |