@@ -25037,7 +25037,7 @@ namespace ts {
25037
25037
type = narrowTypeBySwitchOnDiscriminant(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd);
25038
25038
}
25039
25039
else if (expr.kind === SyntaxKind.TypeOfExpression && isMatchingReference(reference, (expr as TypeOfExpression).expression)) {
25040
- type = narrowBySwitchOnTypeOf (type, flow.switchStatement, flow.clauseStart, flow.clauseEnd);
25040
+ type = narrowTypeBySwitchOnTypeOf (type, flow.switchStatement, flow.clauseStart, flow.clauseEnd);
25041
25041
}
25042
25042
else {
25043
25043
if (strictNullChecks) {
@@ -25329,7 +25329,7 @@ namespace ts {
25329
25329
!!getApplicableIndexInfoForName(type, propName) || !assumeTrue;
25330
25330
}
25331
25331
25332
- function narrowByInKeyword (type: Type, nameType: StringLiteralType | NumberLiteralType | UniqueESSymbolType, assumeTrue: boolean) {
25332
+ function narrowTypeByInKeyword (type: Type, nameType: StringLiteralType | NumberLiteralType | UniqueESSymbolType, assumeTrue: boolean) {
25333
25333
const name = getPropertyNameFromType(nameType);
25334
25334
const isKnownProperty = someType(type, t => isTypePresencePossible(t, name, /*assumeTrue*/ true));
25335
25335
if (isKnownProperty) {
@@ -25411,7 +25411,7 @@ namespace ts {
25411
25411
return getTypeWithFacts(type, assumeTrue ? TypeFacts.NEUndefined : TypeFacts.EQUndefined);
25412
25412
}
25413
25413
if (isMatchingReference(reference, target)) {
25414
- return narrowByInKeyword (type, leftType as StringLiteralType | NumberLiteralType | UniqueESSymbolType, assumeTrue);
25414
+ return narrowTypeByInKeyword (type, leftType as StringLiteralType | NumberLiteralType | UniqueESSymbolType, assumeTrue);
25415
25415
}
25416
25416
}
25417
25417
break;
@@ -25611,7 +25611,7 @@ namespace ts {
25611
25611
neverType);
25612
25612
}
25613
25613
25614
- function narrowBySwitchOnTypeOf (type: Type, switchStatement: SwitchStatement, clauseStart: number, clauseEnd: number): Type {
25614
+ function narrowTypeBySwitchOnTypeOf (type: Type, switchStatement: SwitchStatement, clauseStart: number, clauseEnd: number): Type {
25615
25615
const witnesses = getSwitchClauseTypeOfWitnesses(switchStatement);
25616
25616
if (!witnesses) {
25617
25617
return type;
0 commit comments