jdk-24/test/langtools/tools/javac/annotations/repeatingAnnotations/RepeatingTargetNotAllowed.java

22 lines
451 B
Java

/**
* @test /nodynamiccopyright/
* @summary Container annotation is not checked for semantic correctness
* @bug 8001114
*
* @compile/fail/ref=RepeatingTargetNotAllowed.out -XDrawDiagnostics RepeatingTargetNotAllowed.java
*/
import java.lang.annotation.*;
@Repeatable(Foos.class)
@interface Foo {}
@Target(ElementType.ANNOTATION_TYPE)
@interface Foos {
Foo[] value();
}
public class RepeatingTargetNotAllowed {
@Foo @Foo int f = 0;
}