Skip to content

Commit 6749141

Browse files
committed
Handle intersection types in getWidenedType
1 parent c5ee5ea commit 6749141

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/compiler/checker.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13597,6 +13597,9 @@ namespace ts {
1359713597
// union includes empty object types (e.g. reducing {} | string to just {}).
1359813598
return getUnionType(widenedTypes, some(widenedTypes, isEmptyObjectType) ? UnionReduction.Subtype : UnionReduction.Literal);
1359913599
}
13600+
if (type.flags & TypeFlags.Intersection) {
13601+
return getIntersectionType(sameMap((<IntersectionType>type).types, getWidenedType));
13602+
}
1360013603
if (isArrayType(type) || isTupleType(type)) {
1360113604
return createTypeReference((<TypeReference>type).target, sameMap((<TypeReference>type).typeArguments, getWidenedType));
1360213605
}

0 commit comments

Comments
 (0)