langtools/test/tools/javac/annotations/repeatingAnnotations/InvalidClsTypeParamTarget.java
changeset 30069 5686d5e44a83
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/InvalidClsTypeParamTarget.java	Thu Apr 30 12:21:50 2015 +0200
@@ -0,0 +1,21 @@
+/**
+ * @test    /nodynamiccopyright/
+ * @bug     8044196
+ * @summary Ensure that containers with target FIELD can't be applied to type parameters.
+ * @compile/fail/ref=InvalidClsTypeParamTarget.out -XDrawDiagnostics InvalidClsTypeParamTarget.java
+ */
+
+import java.lang.annotation.*;
+
+class InvalidClsTypeParamTarget {
+
+    @Target({ElementType.TYPE_PARAMETER, ElementType.TYPE_USE, ElementType.FIELD})
+    @Repeatable(TC.class)
+    @interface T { int value(); }
+
+    @Target(ElementType.FIELD)
+    @interface TC { T[] value(); }
+
+    class Test<@T(1) @T(2) N> {
+    }
+}