mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
more specific inference: do not compare functional types if both methods were generic
This commit is contained in:
+2
-1
@@ -540,7 +540,8 @@ public class JavaMethodsConflictResolver implements PsiConflictResolver{
|
||||
return Specifics.FIRST;
|
||||
}
|
||||
}
|
||||
if (languageLevel.isAtLeast(LanguageLevel.JDK_1_8) && myArgumentsList instanceof PsiExpressionList) {
|
||||
|
||||
if (languageLevel.isAtLeast(LanguageLevel.JDK_1_8) && myArgumentsList instanceof PsiExpressionList && (typeParameters1.length == 0 || typeParameters2.length == 0)) {
|
||||
boolean toCompareFunctional = false;
|
||||
for (int i = 0; i < myActualParameterTypes.length; i++) {
|
||||
if (types1.length > 0 && LambdaUtil.isFunctionalType(types1[Math.min(i, types1.length - 1)]) &&
|
||||
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
|
||||
|
||||
class A {
|
||||
Collection<String> thrownInTryStatement = null;
|
||||
final Collection<String> thrownTypes = ContainerUtil.newHashSet( thrownInTryStatement);
|
||||
}
|
||||
|
||||
|
||||
class ContainerUtil extends ContainerUtilRt{
|
||||
public static <T> HashSet<T> newHashSet(Iterable<? extends T> iterable) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class ContainerUtilRt {
|
||||
public static <T> HashSet<T> newHashSet(Iterable<? extends T> iterable) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
+4
@@ -148,6 +148,10 @@ public class GraphInferenceHighlightingTest extends LightDaemonAnalyzerTestCase
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testStaticInheritorsAmbiguity() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
private void doTest() throws Exception {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user