We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d0fc077 commit f9681e2Copy full SHA for f9681e2
1 file changed
src/compiler/checker.ts
@@ -8850,8 +8850,9 @@ namespace ts {
8850
return true;
8851
}
8852
8853
- // Remove all unions of primitive types from the given list and replace them with a
8854
- // single union containing an intersection of those primitive types.
+ // If the given list of types contains more than one union of primitive types, replace the
+ // first with a union containing an intersection of those primitive types, then remove the
8855
+ // other unions and return true. Otherwise, do nothing and return false.
8856
function intersectUnionsOfPrimitiveTypes(types: Type[]) {
8857
let unionTypes: UnionType[] | undefined;
8858
const index = findIndex(types, t => (t.flags & TypeFlags.UnionOfPrimitiveTypes) !== 0);
0 commit comments