Remove incorrect optimization in getUnionConstraintOfIntersection

This commit is contained in:
Anders Hejlsberg 2019-04-13 08:15:28 -10:00
parent 4fee628447
commit b9f805f2f4

View file

@ -7598,11 +7598,6 @@ namespace ts {
constraint = getConstraintOfType(constraint);
}
if (constraint) {
// A constraint that isn't a union type implies that the final type would be a non-union
// type as well. Since non-union constraints are of no interest, we can exit here.
if (!(constraint.flags & TypeFlags.Union)) {
return undefined;
}
constraints = append(constraints, constraint);
}
}