Files
Tagir Valeevandintellij-monorepo-bot 132f486314 IDEA-380311 [java-highlighting] Invalid code "cannot referenced from static context" not highlighted properly in Java
Follow-up: proper qualified references handling


(cherry picked from commit c7f470065ab5c4ad97c9fb6ba02d6fa603e62a84)

IJ-CR-194233

GitOrigin-RevId: 62df1ea06043b6475aa868ab70f0f413261c89d6
2026-03-04 10:47:55 +00:00

39 lines
693 B
Java

class A {
A(C c) {}
static class B extends A {
B() {
super(<error descr="'A.this' cannot be referenced from a static context">A.this</error>.new C());
}
B(int x) {
super(<error descr="'A.this' cannot be referenced from a static context">A.this</error>.getC());
}
B(double x) {
super(<error descr="'A.this' cannot be referenced from a static context">A.this</error>.c);
}
}
class B1 extends A {
B1() {
super(A.this.new C());
}
B1(int x) {
super(A.this.getC());
}
B1(double x) {
super(A.this.c);
}
}
private C getC() {
return new C();
}
private C c = new C();
private class C {}
}