mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
IDEA-380311 [java-highlighting] Invalid code "cannot referenced from static context" not highlighted properly in Java
(cherry picked from commit e1d8918aca30a74ffbf3d3bbf8af07c6f45b5244) IJ-CR-194233 GitOrigin-RevId: f5918ea65adb2bf6ccae0835c52e826b88deb0ad
This commit is contained in:
committed by
intellij-monorepo-bot
parent
7ddee33f31
commit
a4f2bd1574
+5
-2
@@ -1668,9 +1668,12 @@ final class ExpressionChecker {
|
||||
PsiClass parentClass = constructor.getContainingClass();
|
||||
if (parentClass == null) return;
|
||||
|
||||
// references to private methods from the outer class are not calls to super methods
|
||||
// references to private methods and fields from the outer class are not calls to super methods
|
||||
// even if the outer class is the superclass
|
||||
if (resolved instanceof PsiMember member && member.hasModifierProperty(PsiModifier.PRIVATE) && referencedClass != parentClass) return;
|
||||
if (resolved instanceof PsiMember member && member.hasModifierProperty(PsiModifier.PRIVATE) &&
|
||||
referencedClass != parentClass && !(member instanceof PsiClass)) {
|
||||
return;
|
||||
}
|
||||
// field or method should be declared in this class or super
|
||||
if (!InheritanceUtil.isInheritorOrSelf(parentClass, referencedClass, true)) return;
|
||||
// and point to our instance
|
||||
|
||||
Reference in New Issue
Block a user