langtools/test/tools/javac/annotations/typeAnnotations/failures/TypeOnAnonClass.java
changeset 21499 203cfd174518
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/failures/TypeOnAnonClass.java	Thu Oct 24 01:27:10 2013 -0400
@@ -0,0 +1,13 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8023682
+ * @summary Cannot annotate an anonymous class with a target type of TYPE
+ * @compile/fail/ref=TypeOnAnonClass.out -XDrawDiagnostics TypeOnAnonClass.java
+ */
+import java.lang.annotation.*;
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.TYPE)
+@interface X {}
+interface Foo {}
+class TypeOnAnonClass { void m() { new @X Foo() {}; } }