aoqi@0: /* aoqi@0: * @test /nodynamiccopyright/ aoqi@0: * @bug 8023682 aoqi@0: * @summary Cannot annotate an anonymous class with a target type of TYPE aoqi@0: * @compile/fail/ref=TypeOnAnonClass.out -XDrawDiagnostics TypeOnAnonClass.java aoqi@0: */ aoqi@0: import java.lang.annotation.*; aoqi@0: aoqi@0: @Retention(RetentionPolicy.RUNTIME) aoqi@0: @Target(ElementType.TYPE) aoqi@0: @interface X {} aoqi@0: interface Foo {} aoqi@0: class TypeOnAnonClass { void m() { new @X Foo() {}; } }