Wed, 21 Aug 2013 16:13:50 -0700
8023515: import type-annotations updates
Reviewed-by: jjg
Contributed-by: wdietl@gmail.com
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 */
9 import java.lang.annotation.Target;
10 import java.lang.annotation.ElementType;
12 class Constructor {
13 // Constructor result type use annotation
14 @A Constructor() { }
16 // Not type parameter annotation
17 @B Constructor(int x) { }
19 // TODO add err: no "this" receiver parameter for constructors
20 // Constructor(@A Constructor this, Object o) { }
22 // TODO: support Outer.this.
23 }
25 class Constructor2 {
26 class Inner {
27 // OK
28 @A Inner() { }
29 }
30 }
32 @Target(ElementType.TYPE_USE)
33 @interface A { }
35 @Target(ElementType.TYPE_PARAMETER)
36 @interface B { }