jdk-24/test/langtools/tools/javac/annotations/repeatingAnnotations/CyclicAnnotation.java
2017-09-12 19:03:39 +02:00

24 lines
476 B
Java

/**
* @test /nodynamiccopyright/
* @bug 7169362
* @author sogoel
* @summary Cyclic annotation not allowed
* @compile/fail/ref=CyclicAnnotation.out -XDrawDiagnostics CyclicAnnotation.java
*/
import java.lang.annotation.Repeatable;
@Repeatable(Foo.class)
@interface Baz {
Foo[] value() default {};
}
@Repeatable(Baz.class)
@interface Foo{
Baz[] value() default {};
}
@Foo(value = {@Baz,@Baz})
@Baz(value = {@Foo,@Foo})
public class CyclicAnnotation {}