Skip to content

Commit 6911acf

Browse files
committed
Remove freshness from literal types in intersections
1 parent 1a7a587 commit 6911acf

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/compiler/checker.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7589,11 +7589,11 @@ namespace ts {
75897589
}
75907590
}
75917591

7592-
// Add the given types to the given type set. Order is preserved, duplicates are removed,
7593-
// and nested types of the given kind are flattened into the set.
7592+
// Add the given types to the given type set. Order is preserved, freshness is removed from literal
7593+
// types, duplicates are removed, and nested types of the given kind are flattened into the set.
75947594
function addTypesToIntersection(typeSet: TypeSet, types: Type[]) {
75957595
for (const type of types) {
7596-
addTypeToIntersection(typeSet, type);
7596+
addTypeToIntersection(typeSet, getRegularTypeOfLiteralType(type));
75977597
}
75987598
}
75997599

0 commit comments

Comments
 (0)