mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 00:11:26 +07:00
non-static fields should not be available in static context even if they are compile time constants (IDEA-150030)
This commit is contained in:
+11
@@ -7,4 +7,15 @@ class Test {
|
||||
<error descr="Inner classes cannot have static declarations">static</error> final Object j = <error descr="Non-static variable 'o' cannot be referenced from a static context">o</error>;
|
||||
}
|
||||
}
|
||||
|
||||
private final String a = "A";
|
||||
static void foo() {
|
||||
System.out.println(<error descr="Non-static field 'a' cannot be referenced from a static context">a</error>);
|
||||
}
|
||||
|
||||
void f() {
|
||||
class A4 {
|
||||
static final String t = <error descr="Non-static field 'a' cannot be referenced from a static context">a</error>;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user