more specific method should be chosen before static access is checked (IDEA-101480)

This commit is contained in:
anna
2013-02-21 15:23:11 +01:00
parent e869310a92
commit 985efd2362
4 changed files with 26 additions and 8 deletions
@@ -0,0 +1,11 @@
class Foo {
public void foo() {}
public static void foo(String... s){}
}
class A {
{
Foo.<error descr="Non-static method 'foo()' cannot be referenced from a static context">foo</error>();
}
}
@@ -166,4 +166,5 @@ public class LightAdvHighlightingJdk7Test extends LightDaemonAnalyzerTestCase {
public void testWrongArgsAndUnknownTypeParams() throws Exception { doTest(false, false); }
public void testAmbiguousMethodCallIDEA97983() throws Exception { doTest(false, false); }
public void testAmbiguousMethodCallIDEA100314() throws Exception { doTest(false, false); }
public void testInstanceMemberNotAccessibleInStaticContext() throws Exception { doTest(false, false); }
}
@@ -204,7 +204,7 @@ public class ResolveMethodTest extends ResolveTestCase {
PsiElement target = resolve();
assertTrue(target instanceof PsiMethod);
PsiMethod method = (PsiMethod) target;
assertEquals(1, method.getParameterList().getParametersCount());
assertEquals(0, method.getParameterList().getParametersCount());
}
public void testClone() throws Exception{