if some type parameter has only weak constraints (from bounds), then we consider it as unknown

This commit is contained in:
Svetlana Isakova
2013-09-26 14:41:48 +04:00
parent 731efd0781
commit cb25e1d55a
3 changed files with 83 additions and 0 deletions
@@ -155,6 +155,15 @@ public class TypeConstraintsImpl implements TypeConstraints {
if (constraints.isEmpty()) {
return Collections.emptyList();
}
boolean hasStrongConstraint = ContainerUtil.exists(constraints, new Condition<Constraint>() {
@Override
public boolean value(Constraint constraint) {
return constraint.constraintPosition.isStrong();
}
});
if (!hasStrongConstraint) {
return Collections.emptyList();
}
Set<JetType> exactBounds = filterBounds(constraints, BoundKind.EXACT_BOUND, values);
if (exactBounds.size() == 1) {