mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-06 05:10:22 +07:00
find class or interface to search the method: stop when accessible method is found even with static problem (IDEA-169504)
This commit is contained in:
@@ -69,7 +69,7 @@ public class MethodCandidatesProcessor extends MethodsProcessor{
|
||||
if (acceptVarargs() && method.isVarArgs() && PsiUtil.isLanguageLevel8OrHigher(myPlace)) {
|
||||
add(createCandidateInfo(method, substitutor, staticProblem, isAccessible, true));
|
||||
}
|
||||
myHasAccessibleStaticCorrectCandidate |= isAccessible && !staticProblem;
|
||||
myHasAccessibleStaticCorrectCandidate |= isAccessible;// && !staticProblem;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
class Foo {
|
||||
static class Bar {
|
||||
static final String s = <error descr="Non-static method 'toString()' cannot be referenced from a static context">toString</error>(1);
|
||||
}
|
||||
static String toString(int x) {
|
||||
return x + "";
|
||||
}
|
||||
}
|
||||
@@ -244,6 +244,10 @@ public class OverloadResolutionTest extends LightDaemonAnalyzerTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testStaticMethodInOuterClassConflictWithToString() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
private void doTest() {
|
||||
doTest(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user