diff options
author | Tor Norbye <tnorbye@google.com> | 2014-09-04 13:24:04 -0700 |
---|---|---|
committer | Tor Norbye <tnorbye@google.com> | 2014-09-04 13:24:04 -0700 |
commit | c3d3a90f6b4ead083d63e28e6b9fcea93d675678 (patch) | |
tree | fc0dcd722b6d445468dbe7dad13b4c11781b1cbe /java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/InferenceIncorporationPhase.java | |
parent | 1aa2e09bdbd413eacb677e9fa4b50630530d0656 (diff) | |
download | idea-c3d3a90f6b4ead083d63e28e6b9fcea93d675678.tar.gz |
Snapshot idea/138.1980 from git://git.jetbrains.org/idea/community.git
Change-Id: Ib567c9c152d770212a7a3db20fbf591c210920bd
Diffstat (limited to 'java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/InferenceIncorporationPhase.java')
-rw-r--r-- | java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/InferenceIncorporationPhase.java | 42 |
1 files changed, 10 insertions, 32 deletions
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 9766122e31d0..9c8b8b4772b3 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 @@ -89,28 +89,6 @@ public class InferenceIncorporationPhase { upDown(lowerBounds, eqBounds, substitutor); upUp(upperBounds); - - for (PsiType eqBound : eqBounds) { - if (mySession.isProperType(eqBound)) { - for (PsiType upperBound : upperBounds) { - if (!mySession.isProperType(upperBound)) { - addConstraint(new StrictSubtypingConstraint(substitutor.substitute(upperBound), eqBound)); - } - } - - for (PsiType lowerBound : lowerBounds) { - if (!mySession.isProperType(lowerBound)) { - addConstraint(new StrictSubtypingConstraint(eqBound, substitutor.substitute(lowerBound))); - } - } - - for (PsiType otherEqBound : eqBounds) { - if (eqBound != otherEqBound && !mySession.isProperType(otherEqBound)) { - addConstraint(new TypeEqualityConstraint(substitutor.substitute(otherEqBound), eqBound)); - } - } - } - } } for (Pair<PsiTypeParameter[], PsiClassType> capture : myCaptures) { @@ -135,7 +113,7 @@ public class InferenceIncorporationPhase { if (aType instanceof PsiWildcardType) { for (PsiType eqBound : eqBounds) { - if (mySession.isProperType(eqBound)) return false; + if (mySession.getInferenceVariable(eqBound) == null) return false; } final PsiClassType[] paramBounds = parameters[i].getExtendsListTypes(); @@ -143,15 +121,15 @@ public class InferenceIncorporationPhase { if (!((PsiWildcardType)aType).isBounded()) { for (PsiType upperBound : upperBounds) { - if (mySession.isProperType(upperBound)) { + if (mySession.getInferenceVariable(upperBound) == null) { for (PsiClassType paramBound : paramBounds) { - addConstraint(new StrictSubtypingConstraint(upperBound, paramBound)); + addConstraint(new StrictSubtypingConstraint(upperBound, mySession.substituteWithInferenceVariables(paramBound))); } } } for (PsiType lowerBound : lowerBounds) { - if (mySession.isProperType(lowerBound)) return false; + if (mySession.getInferenceVariable(lowerBound) == null) return false; } } else if (((PsiWildcardType)aType).isExtends()) { @@ -159,19 +137,19 @@ public class InferenceIncorporationPhase { final PsiType extendsBound = ((PsiWildcardType)aType).getExtendsBound(); for (PsiType upperBound : upperBounds) { - if (mySession.isProperType(upperBound)) { + if (mySession.getInferenceVariable(upperBound) == null) { if (paramBounds.length == 1 && paramBounds[0].equalsToText(CommonClassNames.JAVA_LANG_OBJECT) || paramBounds.length == 0) { addConstraint(new StrictSubtypingConstraint(upperBound, extendsBound)); } else if (extendsBound.equalsToText(CommonClassNames.JAVA_LANG_OBJECT)) { for (PsiClassType paramBound : paramBounds) { - addConstraint(new StrictSubtypingConstraint(upperBound, paramBound)); + addConstraint(new StrictSubtypingConstraint(upperBound, mySession.substituteWithInferenceVariables(paramBound))); } } } } for (PsiType lowerBound : lowerBounds) { - if (mySession.isProperType(lowerBound)) return false; + if (mySession.getInferenceVariable(lowerBound) == null) return false; } } else { @@ -179,15 +157,15 @@ public class InferenceIncorporationPhase { final PsiType superBound = ((PsiWildcardType)aType).getSuperBound(); for (PsiType upperBound : upperBounds) { - if (mySession.isProperType(upperBound)) { + if (mySession.getInferenceVariable(upperBound) == null) { for (PsiClassType paramBound : paramBounds) { - addConstraint(new StrictSubtypingConstraint(paramBound, upperBound)); + addConstraint(new StrictSubtypingConstraint(mySession.substituteWithInferenceVariables(paramBound), upperBound)); } } } for (PsiType lowerBound : lowerBounds) { - if (mySession.isProperType(lowerBound)) { + if (mySession.getInferenceVariable(lowerBound) == null) { addConstraint(new StrictSubtypingConstraint(lowerBound, superBound)); } } |