new inference: stop at first common supertypes pair during incorporation of upper bounds (IDEA-147393)

This commit is contained in:
Anna Kozlova
2015-11-05 15:24:18 +01:00
parent 86a396d8ea
commit 6e853bf571
3 changed files with 18 additions and 1 deletions
@@ -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;
}
@@ -0,0 +1,13 @@
interface I<T>{}
abstract class A<T> implements I<A<T>>{}
class Factory {
static <T extends A<?>> T get(Class<T> c){
return null;
}
}
class Impl extends A<Impl> {
static Impl get() {
return Factory.get(Impl.class);
}
}
@@ -311,6 +311,10 @@ public class GraphInferenceHighlightingTest extends LightDaemonAnalyzerTestCase
doTest();
}
public void testAcceptFirstPairOfCommonSupertypesDuringUpUpIncorporation() throws Exception {
doTest();
}
private void doTest() throws Exception {
doTest(false);
}