new inference: reject multiple eq bounds

This commit is contained in:
anna
2013-11-07 20:49:32 +01:00
parent fe23143c0b
commit 465762a96e
@@ -427,16 +427,17 @@ public class InferenceSession {
inferenceVariable.setInstantiation(null);
continue;
}
PsiType bound = null;
for (PsiType eqBound : eqBounds) {
if (eqBound == null) continue;
if (bound != null && !isProperType(eqBound)) continue;
bound = acceptBoundsWithRecursiveDependencies(typeParameter, eqBound, substitutor);
}
if (bound != null) {
if (bound instanceof PsiCapturedWildcardType && eqBounds.size() > 1) {
continue;
if (eqBounds.size() > 1) {
for (Iterator<PsiType> iterator = eqBounds.iterator(); iterator.hasNext(); ) {
PsiType eqBound = iterator.next();
if (PsiUtil.resolveClassInType(eqBound) == typeParameter) {
iterator.remove();
}
}
if (eqBounds.size() > 1) continue;
}
PsiType bound = eqBounds.isEmpty() ? null : acceptBoundsWithRecursiveDependencies(typeParameter, eqBounds.get(0), substitutor);
if (bound != null) {
inferenceVariable.setInstantiation(bound);
} else {
PsiType lub = null;