check all upper bounds even if there are some error types in bounds
for cases like 'val l:List<Int> = id(newList())' List<???> is a lower bound for id's type parameter here
This commit is contained in:
-2
@@ -64,14 +64,12 @@ public class ConstraintsUtil {
|
|||||||
}
|
}
|
||||||
addToValuesIfDifferent(superTypeOfLowerBounds, values);
|
addToValuesIfDifferent(superTypeOfLowerBounds, values);
|
||||||
|
|
||||||
if (values.isEmpty()) {
|
|
||||||
Collection<JetType> upperBounds = typeConstraintsWithoutErrorTypes.getUpperBounds();
|
Collection<JetType> upperBounds = typeConstraintsWithoutErrorTypes.getUpperBounds();
|
||||||
for (JetType upperBound : upperBounds) {
|
for (JetType upperBound : upperBounds) {
|
||||||
if (trySuggestion(upperBound, typeConstraints)) {
|
if (trySuggestion(upperBound, typeConstraints)) {
|
||||||
return Collections.singleton(upperBound);
|
return Collections.singleton(upperBound);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
//todo
|
//todo
|
||||||
//fun <T> foo(t: T, consumer: Consumer<T>): T
|
//fun <T> foo(t: T, consumer: Consumer<T>): T
|
||||||
//foo(1, c: Consumer<Any>) - infer Int, not Any here
|
//foo(1, c: Consumer<Any>) - infer Int, not Any here
|
||||||
|
|||||||
Reference in New Issue
Block a user