support one more special case of propagating bound constraints
(temporary while there is no common constraint system and its resolution)
This commit is contained in:
+11
@@ -437,6 +437,17 @@ public class ConstraintSystemImpl implements ConstraintSystem {
|
||||
addSubtypeConstraint(constraint.type, declaredUpperBound, position);
|
||||
}
|
||||
}
|
||||
ClassifierDescriptor declarationDescriptor = declaredUpperBound.getConstructor().getDeclarationDescriptor();
|
||||
if (declarationDescriptor instanceof TypeParameterDescriptor && typeParameterConstraints.containsKey(declarationDescriptor)) {
|
||||
TypeConstraintsImpl typeConstraintsForUpperBound = typeParameterConstraints.get(declarationDescriptor);
|
||||
for (Constraint constraint : typeConstraintsForUpperBound.getConstraints()) {
|
||||
if (constraint.boundKind == UPPER_BOUND || constraint.boundKind == EXACT_BOUND) {
|
||||
ConstraintPosition position = ConstraintPosition.getCompoundConstraintPosition(
|
||||
ConstraintPosition.getTypeBoundPosition(typeParameterDescriptor.getIndex()), constraint.constraintPosition);
|
||||
typeConstraints.addConstraint(UPPER_BOUND, constraint.type, position);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user