diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/InferenceIncorporationPhase.java b/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/InferenceIncorporationPhase.java index 1a4ad6a932fc..4f9d1f7f4837 100644 --- a/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/InferenceIncorporationPhase.java +++ b/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/InferenceIncorporationPhase.java @@ -301,7 +301,7 @@ public class InferenceIncorporationPhase { if (!(sType instanceof PsiWildcardType) && !(tType instanceof PsiWildcardType) && sType != null && tType != null) { addConstraint(new TypeEqualityConstraint(sType, tType)); } - return true; + return false; } }) != null; } diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/graphInference/AcceptFirstPairOfCommonSupertypesDuringUpUpIncorporation.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/graphInference/AcceptFirstPairOfCommonSupertypesDuringUpUpIncorporation.java new file mode 100644 index 000000000000..4b7b960499b9 --- /dev/null +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/graphInference/AcceptFirstPairOfCommonSupertypesDuringUpUpIncorporation.java @@ -0,0 +1,13 @@ +interface I{} +abstract class A implements I>{} +class Factory { + static > T get(Class c){ + return null; + } +} + +class Impl extends A { + static Impl get() { + return Factory.get(Impl.class); + } +} \ No newline at end of file diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/GraphInferenceHighlightingTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/GraphInferenceHighlightingTest.java index 411f4cb826f0..428d3e858a87 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/GraphInferenceHighlightingTest.java +++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/GraphInferenceHighlightingTest.java @@ -311,6 +311,10 @@ public class GraphInferenceHighlightingTest extends LightDaemonAnalyzerTestCase doTest(); } + public void testAcceptFirstPairOfCommonSupertypesDuringUpUpIncorporation() throws Exception { + doTest(); + } + private void doTest() throws Exception { doTest(false); }