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