mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
overload resolution: skip static correctness check during overload resolution (IDEA-154187)
This commit is contained in:
-3
@@ -134,9 +134,6 @@ public class JavaMethodsConflictResolver implements PsiConflictResolver{
|
||||
checkPrimitiveVarargs(conflicts, getActualParametersLength());
|
||||
if (conflicts.size() == 1) return conflicts.get(0);
|
||||
|
||||
checkAccessStaticLevels(conflicts, false);
|
||||
if (conflicts.size() == 1) return conflicts.get(0);
|
||||
|
||||
Set<CandidateInfo> uniques = new THashSet<CandidateInfo>(conflicts);
|
||||
if (uniques.size() == 1) return uniques.iterator().next();
|
||||
return null;
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
class A<T> {
|
||||
public void testMethod(T... values) {}
|
||||
public void testMethod1(T values) {}
|
||||
}
|
||||
|
||||
class B extends A<Integer> {
|
||||
public static void testMethod(String... values) {}
|
||||
public static void testMethod1(String values) {}
|
||||
}
|
||||
|
||||
class Test45 {
|
||||
public static void main(String[] args) {
|
||||
B.testMethod<error descr="Ambiguous method call: both 'B.testMethod(String...)' and 'A.testMethod(Integer...)' match">()</error>;
|
||||
B.testMethod1<error descr="Ambiguous method call: both 'B.testMethod1(String)' and 'A.testMethod1(Integer)' match">(null)</error>;
|
||||
}
|
||||
}
|
||||
+4
@@ -225,6 +225,10 @@ public class OverloadResolutionTest extends LightDaemonAnalyzerTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIgnoreStaticCorrectnessDuringOverloadResolution() throws Exception {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
private void doTest() {
|
||||
doTest(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user