fixed bug in renderer for violated upper bound error

This commit is contained in:
Svetlana Isakova
2013-12-24 14:52:58 +04:00
committed by Andrey Breslav
parent c3ff6a2430
commit 4657a4b271
4 changed files with 22 additions and 2 deletions
@@ -267,7 +267,8 @@ public class Renderers {
TypeParameterDescriptor typeParameterDescriptor = null;
ConstraintSystemImpl constraintSystem = (ConstraintSystemImpl) inferenceErrorData.constraintSystem;
assert constraintSystem.getStatus().hasViolatedUpperBound();
ConstraintSystemStatus status = constraintSystem.getStatus();
assert status.hasViolatedUpperBound();
ConstraintSystem systemWithoutWeakConstraints = constraintSystem.getSystemWithoutWeakConstraints();
for (TypeParameterDescriptor typeParameter : inferenceErrorData.descriptor.getTypeParameters()) {
@@ -275,6 +276,9 @@ public class Renderers {
typeParameterDescriptor = typeParameter;
}
}
if (typeParameterDescriptor == null && status.hasConflictingConstraints()) {
return renderConflictingSubstitutionsInferenceError(inferenceErrorData, result);
}
assert typeParameterDescriptor != null : errorMessage;
JetType inferredValueForTypeParameter = systemWithoutWeakConstraints.getTypeBounds(typeParameterDescriptor).getValue();