aoqi@0: /* aoqi@0: * @test /nodynamiccopyright/ aoqi@0: * @bug 6843077 8006775 aoqi@0: * @summary test invalid location of TypeUse aoqi@0: * @author Mahmood Ali aoqi@0: * @compile/fail/ref=Constructor.out -XDrawDiagnostics Constructor.java aoqi@0: */ aoqi@0: aoqi@0: import java.lang.annotation.Target; aoqi@0: import java.lang.annotation.ElementType; aoqi@0: aoqi@0: class Constructor { aoqi@0: // Constructor result type use annotation aoqi@0: @A Constructor() { } aoqi@0: aoqi@0: // Not type parameter annotation aoqi@0: @B Constructor(int x) { } aoqi@0: aoqi@0: // TODO add err: no "this" receiver parameter for constructors aoqi@0: // Constructor(@A Constructor this, Object o) { } aoqi@0: aoqi@0: // TODO: support Outer.this. aoqi@0: } aoqi@0: aoqi@0: class Constructor2 { aoqi@0: class Inner { aoqi@0: // OK aoqi@0: @A Inner() { } aoqi@0: } aoqi@0: } aoqi@0: aoqi@0: @Target(ElementType.TYPE_USE) aoqi@0: @interface A { } aoqi@0: aoqi@0: @Target(ElementType.TYPE_PARAMETER) aoqi@0: @interface B { } aoqi@0: