new inference: do not skip contradicted bounds

(cherry picked from commit 8ce52d2dc87cfde0471a65c55df972711bffa1c4)
This commit is contained in:
anna
2013-11-25 16:47:25 +01:00
parent fa579af4c3
commit 72cf9108c8
@@ -142,9 +142,8 @@ public class InferenceIncorporationPhase {
*/
private void upDown(List<PsiType> eqBounds, List<PsiType> upperBounds) {
for (PsiType upperBound : upperBounds) {
final boolean properType = mySession.isProperType(upperBound);
if (upperBound == null) continue;
for (PsiType eqBound : eqBounds) {
if (properType && mySession.isProperType(eqBound)) continue;
if (!upperBound.equals(eqBound) && !upperBound.equalsToText(CommonClassNames.JAVA_LANG_OBJECT)) {
addConstraint(new SubtypingConstraint(upperBound, eqBound, true));
}
@@ -157,9 +156,8 @@ public class InferenceIncorporationPhase {
*/
private void upperLower(List<PsiType> upperBounds, List<PsiType> lowerBounds) {
for (PsiType upperBound : upperBounds) {
final boolean properType = mySession.isProperType(upperBound);
if (upperBound == null) continue;
for (PsiType lowerBound : lowerBounds) {
if (properType && mySession.isProperType(lowerBound)) continue;
if (!upperBound.equals(lowerBound)) {
addConstraint(new SubtypingConstraint(upperBound, lowerBound, true));
}