IDEA-105101 Java: bad code is green: cyclic annotation element types

(JLS 9.6.1. Annotation Type Elements)
This commit is contained in:
anna
2013-04-11 12:14:01 +02:00
parent f791e0526f
commit 42763f9275
4 changed files with 47 additions and 2 deletions

View File

@@ -0,0 +1,27 @@
@interface A1 {
<error descr="Cyclic annotation element type">B1</error> value();
}
@interface B1 {
<error descr="Cyclic annotation element type">A1</error> value();
}
@interface C1 {
A1 value();
}
@interface D1 {
<error descr="Cyclic annotation element type">D1</error> value();
}
enum E1 {
E_1;
@F(E_1)
void foo() {
}
}
@interface F {
E1 value();
}

View File

@@ -1,7 +1,7 @@
import java.util.Collection;
@interface Anno {
Anno[] nested() default {};
<error descr="Cyclic annotation element type">Anno[]</error> nested() default {};
}
abstract class C {