Remove freshness from literal types in intersections

This commit is contained in:
Anders Hejlsberg
2017-11-02 14:28:46 -07:00
parent 1a7a587a9e
commit 6911acf80b

View File

@@ -7589,11 +7589,11 @@ namespace ts {
}
}
// Add the given types to the given type set. Order is preserved, duplicates are removed,
// and nested types of the given kind are flattened into the set.
// Add the given types to the given type set. Order is preserved, freshness is removed from literal
// types, duplicates are removed, and nested types of the given kind are flattened into the set.
function addTypesToIntersection(typeSet: TypeSet, types: Type[]) {
for (const type of types) {
addTypeToIntersection(typeSet, type);
addTypeToIntersection(typeSet, getRegularTypeOfLiteralType(type));
}
}