File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -3634,10 +3634,6 @@ module ts {
3634
3634
return type;
3635
3635
}
3636
3636
3637
- function getUnionTypeOfSubtypeConstituents(source: UnionType, target: Type): Type {
3638
- return getUnionType(filter(source.types, t => isTypeSubtypeOf(t, target)));
3639
- }
3640
-
3641
3637
function getReducedTypeOfUnionType(type: UnionType): Type {
3642
3638
// If union type was created without subtype reduction, perform the deferred reduction now
3643
3639
if (!type.reducedType) {
@@ -5399,7 +5395,7 @@ module ts {
5399
5395
}
5400
5396
// If the current type is a union type, remove all constituents that aren't subtypes of the target.
5401
5397
if (type.flags & TypeFlags.Union) {
5402
- return getUnionTypeOfSubtypeConstituents( <UnionType>type, targetType);
5398
+ return getUnionType(filter(( <UnionType>type).types, t => isTypeSubtypeOf(t, targetType)) );
5403
5399
}
5404
5400
}
5405
5401
}
@@ -5416,7 +5412,7 @@ module ts {
5416
5412
let instanceType = getUnionType(map(constructSignatures, signature => getReturnTypeOfSignature(getErasedSignature(signature))));
5417
5413
// Pickup type from union types
5418
5414
if (type.flags & TypeFlags.Union) {
5419
- return getUnionTypeOfSubtypeConstituents( <UnionType>type, instanceType);
5415
+ return getUnionType(filter(( <UnionType>type).types, t => isTypeSubtypeOf(t, instanceType)) );
5420
5416
}
5421
5417
return instanceType;
5422
5418
}
You can’t perform that action at this time.
0 commit comments