mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
extend check for enclosing instance for java 8 default methods in interfaces (IDEA-140492)
This commit is contained in:
+6
@@ -1522,6 +1522,12 @@ public class HighlightUtil extends HighlightUtilBase {
|
||||
.descriptionAndTooltip(JavaErrorMessages.message("bad.qualifier.in.super.method.reference", format(aClass), formatClass(superClass))).create();
|
||||
}
|
||||
}
|
||||
|
||||
if (expr instanceof PsiSuperExpression && !classT.isInheritor(aClass, false)) {
|
||||
return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR)
|
||||
.range(qualifier)
|
||||
.descriptionAndTooltip(JavaErrorMessages.message("no.enclosing.instance.in.scope", format(aClass))).create();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+7
@@ -38,5 +38,12 @@ class Test {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
interface D extends J {
|
||||
default void m() {
|
||||
<error descr="No enclosing instance of type 'Test.D' is in scope">D</error>.super.toString();
|
||||
J.super.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user