mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
no enclosing instance: sibling static nested class should be also be checked (IDEA-105004)
This commit is contained in:
+1
-1
@@ -772,7 +772,7 @@ public class HighlightClassUtil {
|
||||
// must be inner class
|
||||
if (!PsiUtil.isInnerClass(base)) return;
|
||||
|
||||
if (resolve == resolved && baseClass != null && !PsiTreeUtil.isAncestor(baseClass, extendRef, true) &&
|
||||
if (resolve == resolved && baseClass != null && (!PsiTreeUtil.isAncestor(baseClass, extendRef, true) || aClass.hasModifierProperty(PsiModifier.STATIC)) &&
|
||||
!hasEnclosingInstanceInScope(baseClass, extendRef, true, true) && !qualifiedNewCalledInConstructors(aClass, baseClass)) {
|
||||
String description = JavaErrorMessages.message("no.enclosing.instance.in.scope", HighlightUtil.formatClass(baseClass));
|
||||
infos[0] = HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(extendRef).descriptionAndTooltip(description).create();
|
||||
|
||||
+5
@@ -95,3 +95,8 @@ public class A42 {
|
||||
class D42 extends A42.B {
|
||||
D42() {new A42().super();}
|
||||
}
|
||||
|
||||
class IDEA105004 {
|
||||
class A {}
|
||||
static class B extends <error descr="No enclosing instance of type 'IDEA105004' is in scope">A</error> {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user