@@ -4469,7 +4469,7 @@ module ts {
4469
4469
Debug.fail("should not get here");
4470
4470
}
4471
4471
4472
- // For a union type, remove all constituent types for that are of the given type kind (when isOfTypeKind is true)
4472
+ // For a union type, remove all constituent types that are of the given type kind (when isOfTypeKind is true)
4473
4473
// or not of the given type kind (when isOfTypeKind is false)
4474
4474
function removeTypesFromUnionType(type: Type, typeKind: TypeFlags, isOfTypeKind: boolean): Type {
4475
4475
if (type.flags & TypeFlags.Union) {
@@ -4683,20 +4683,20 @@ module ts {
4683
4683
if (assumeTrue) {
4684
4684
// Assumed result is true. If check was not for a primitive type, remove all primitive types
4685
4685
if (!typeInfo) {
4686
- return removeTypesFromUnionType(type, TypeFlags.StringLike | TypeFlags.NumberLike | TypeFlags.Boolean, true);
4686
+ return removeTypesFromUnionType(type, /*typeKind*/ TypeFlags.StringLike | TypeFlags.NumberLike | TypeFlags.Boolean, /*isOfTypeKind*/ true);
4687
4687
}
4688
4688
// Check was for a primitive type, return that primitive type if it is a subtype
4689
4689
if (isTypeSubtypeOf(typeInfo.type, type)) {
4690
4690
return typeInfo.type;
4691
4691
}
4692
4692
// Otherwise, remove all types that aren't of the primitive type kind. This can happen when the type is
4693
4693
// union of enum types and other types.
4694
- return removeTypesFromUnionType(type, typeInfo.flags, false);
4694
+ return removeTypesFromUnionType(type, /*typeKind*/ typeInfo.flags, /*isOfTypeKind*/ false);
4695
4695
}
4696
4696
else {
4697
4697
// Assumed result is false. If check was for a primitive type, remove that primitive type
4698
4698
if (typeInfo) {
4699
- return removeTypesFromUnionType(type, typeInfo.flags, true);
4699
+ return removeTypesFromUnionType(type, /*typeKind*/ typeInfo.flags, /*isOfTypeKind*/ true);
4700
4700
}
4701
4701
// Otherwise we don't have enough information to do anything.
4702
4702
return type;
0 commit comments