mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
reference to static method from interface: prefer static import context if provided (IDEA-130136)
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
import p.*;
|
||||
import static p.Foo.bar;
|
||||
import static p.Boo.*;
|
||||
|
||||
class FooImpl implements Foo, Boo {
|
||||
public void baz() {
|
||||
<error descr="Static method may be invoked on containing interface class only">foo();</error>
|
||||
bar();
|
||||
boo();
|
||||
}
|
||||
}
|
||||
+11
@@ -47,6 +47,17 @@ public class Interface8MethodsHighlightingTest extends LightCodeInsightFixtureTe
|
||||
doTest(false, false);
|
||||
}
|
||||
|
||||
public void testStaticMethodAccessibleBothThroughStaticImportAndInheritance() throws Exception {
|
||||
myFixture.addClass("package p; public interface Foo {" +
|
||||
" static void foo() {}" +
|
||||
" static void bar() {}" +
|
||||
"}");
|
||||
myFixture.addClass("package p; public interface Boo {" +
|
||||
" static void boo() {}" +
|
||||
"}");
|
||||
doTest(false, false);
|
||||
}
|
||||
|
||||
public void testSuperProtectedCalls() throws Exception {
|
||||
myFixture.addClass("package p; public class Foo {" +
|
||||
" protected void foo(){}" +
|
||||
|
||||
Reference in New Issue
Block a user