mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
new inference: reject multiple eq bounds
This commit is contained in:
+10
-9
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user