mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-06 05:10:22 +07:00
access static via instance for calls on interface refs (IDEA-183919)
This commit is contained in:
@@ -381,6 +381,7 @@ public class HighlightMethodUtil {
|
||||
String message = checkStaticInterfaceMethodCallQualifier(referenceToMethod, resolveResult.getCurrentFileResolveScope(), containingClass);
|
||||
if (message != null) {
|
||||
highlightInfo = HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).descriptionAndTooltip(message).range(fixRange).create();
|
||||
QuickFixAction.registerQuickFixAction(highlightInfo, fixRange, QUICK_FIX_FACTORY.createAccessStaticViaInstanceFix(referenceToMethod, resolveResult));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
// "Access static 'I.m()' via class 'I' reference" "true"
|
||||
interface I {
|
||||
static void m() {}
|
||||
}
|
||||
|
||||
class A {
|
||||
void f(I i){
|
||||
I.m();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// "Access static 'I.m()' via class 'I' reference" "true"
|
||||
interface I {
|
||||
static void m() {}
|
||||
}
|
||||
|
||||
class A {
|
||||
void f(I i){
|
||||
i.<caret>m();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user