Don't add a constraint T <: DONT_CARE from upper bounds

This commit is contained in:
Svetlana Isakova
2014-12-02 15:14:48 +03:00
parent f9d4a68c6e
commit 070dba69fa
2 changed files with 2 additions and 2 deletions
@@ -4,7 +4,7 @@ SUBTYPE T Int
type parameter bounds:
T <: kotlin.Int(SPECIAL)
P <: ???(TYPE_BOUND_POSITION(1)), <: kotlin.Int(COMPOUND_CONSTRAINT_POSITION(TYPE_BOUND_POSITION(1), SPECIAL)
P <: kotlin.Int(COMPOUND_CONSTRAINT_POSITION(TYPE_BOUND_POSITION(1), SPECIAL)
status:
-hasCannotCaptureTypesError: false
-hasConflictingConstraints: false
@@ -149,7 +149,7 @@ public class ConstraintSystemImpl : ConstraintSystem {
for (declaredUpperBound in typeVariable.getUpperBounds()) {
if (KotlinBuiltIns.getInstance().getNullableAnyType() == declaredUpperBound) continue //todo remove this line (?)
val substitutedBound = constantSubstitutor?.substitute(declaredUpperBound, Variance.INVARIANT)
if (substitutedBound != null) {
if (substitutedBound != null && !isErrorOrSpecialType(substitutedBound)) {
typeBounds.addBound(UPPER_BOUND, substitutedBound, TYPE_BOUND_POSITION.position(typeVariable.getIndex()))
}
}