Files
Bas Leijdekkers 60a6cb2a00 Java: Provide better error message - illegal forward reference (IDEA-337031)
GitOrigin-RevId: 789b0bca6e6b1f9d0d366cd20a011c194cf1af0d
2023-11-06 11:16:57 +00:00

20 lines
679 B
Java

package test;
class Test {
void foo() {
enum Enum {
A(<error descr="Cannot refer to enum constant 'B' before its definition">B</error>.var),
B(A.var),
C(<error descr="Cannot read value of field 'constant' before the field's definition">constant</error>),
D(<error descr="Cannot read value of field 'staticVar' before the field's definition">Enum.staticVar</error>),
E(<error descr="Cannot read value of field 'staticVar' before the field's definition">staticVar</error>),
;
Enum(String str) {
}
static final String constant = "const";
static String staticVar = "staticVar";
String var = "var";
}
}
}