Skip to content

Commit 35b2038

Browse files
committed
Addressing CR feedback
1 parent 75404a7 commit 35b2038

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/compiler/checker.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4469,7 +4469,7 @@ module ts {
44694469
Debug.fail("should not get here");
44704470
}
44714471

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)
44734473
// or not of the given type kind (when isOfTypeKind is false)
44744474
function removeTypesFromUnionType(type: Type, typeKind: TypeFlags, isOfTypeKind: boolean): Type {
44754475
if (type.flags & TypeFlags.Union) {
@@ -4683,20 +4683,20 @@ module ts {
46834683
if (assumeTrue) {
46844684
// Assumed result is true. If check was not for a primitive type, remove all primitive types
46854685
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);
46874687
}
46884688
// Check was for a primitive type, return that primitive type if it is a subtype
46894689
if (isTypeSubtypeOf(typeInfo.type, type)) {
46904690
return typeInfo.type;
46914691
}
46924692
// Otherwise, remove all types that aren't of the primitive type kind. This can happen when the type is
46934693
// union of enum types and other types.
4694-
return removeTypesFromUnionType(type, typeInfo.flags, false);
4694+
return removeTypesFromUnionType(type, /*typeKind*/ typeInfo.flags, /*isOfTypeKind*/ false);
46954695
}
46964696
else {
46974697
// Assumed result is false. If check was for a primitive type, remove that primitive type
46984698
if (typeInfo) {
4699-
return removeTypesFromUnionType(type, typeInfo.flags, true);
4699+
return removeTypesFromUnionType(type, /*typeKind*/ typeInfo.flags, /*isOfTypeKind*/ true);
47004700
}
47014701
// Otherwise we don't have enough information to do anything.
47024702
return type;

0 commit comments

Comments
 (0)