mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-06 05:10:22 +07:00
TypeName.super.foo() when TypeName denotes interface
This commit is contained in:
@@ -1448,8 +1448,8 @@ public class HighlightUtil extends HighlightUtilBase {
|
||||
return HighlightClassUtil.reportIllegalEnclosingUsage(expr, null, aClass, expr);
|
||||
}
|
||||
|
||||
if (qualifier != null && expr.getParent() instanceof PsiMethodReferenceExpression && aClass.isInterface()) {
|
||||
//15.13
|
||||
if (qualifier != null && aClass.isInterface() && languageLevel.isAtLeast(LanguageLevel.JDK_1_8)) {
|
||||
//15.12.1 for method invocation expressions; 15.13 for method references
|
||||
//If TypeName denotes an interface, I, then let T be the type declaration immediately enclosing the method reference expression.
|
||||
//It is a compile-time error if I is not a direct superinterface of T,
|
||||
//or if there exists some other direct superclass or direct superinterface of T, J, such that J is a subtype of I.
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
interface I {
|
||||
default void m() {}
|
||||
|
||||
}
|
||||
interface J extends I {}
|
||||
|
||||
class C implements I, J {
|
||||
{
|
||||
<error descr="Bad type qualifier in default super call: redundant interface I is extended by J">I</error>.super.m();
|
||||
}
|
||||
}
|
||||
@@ -788,6 +788,10 @@ public class GenericsHighlighting8Test extends LightDaemonAnalyzerTestCase {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
public void testSuperInterfaceMethodCalledByMatterOfInterface() throws Exception {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
private void doTest() {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user