@@ -4309,7 +4309,7 @@ namespace ts {
4309
4309
parentType = getNonNullableType(parentType);
4310
4310
}
4311
4311
const propType = getTypeOfPropertyOfType(parentType, text);
4312
- const declaredType = propType && getDeclaredOrApparentType (propType, declaration.name);
4312
+ const declaredType = propType && getApparentTypeForLocation (propType, declaration.name);
4313
4313
type = declaredType && getFlowTypeOfReference(declaration, declaredType) ||
4314
4314
isNumericLiteralName(text) && getIndexTypeOfType(parentType, IndexKind.Number) ||
4315
4315
getIndexTypeOfType(parentType, IndexKind.String);
@@ -13162,7 +13162,7 @@ namespace ts {
13162
13162
return type.flags & TypeFlags.TypeVariable && maybeTypeOfKind(getBaseConstraintOfType(type) || emptyObjectType, TypeFlags.Nullable);
13163
13163
}
13164
13164
13165
- function getDeclaredOrApparentType (type: Type, node: Node) {
13165
+ function getApparentTypeForLocation (type: Type, node: Node) {
13166
13166
// When a node is the left hand expression of a property access, element access, or call expression,
13167
13167
// and the type of the node includes type variables with constraints that are nullable, we fetch the
13168
13168
// apparent type of the node *before* performing control flow analysis such that narrowings apply to
@@ -13256,7 +13256,7 @@ namespace ts {
13256
13256
checkCollisionWithCapturedNewTargetVariable(node, node);
13257
13257
checkNestedBlockScopedBinding(node, symbol);
13258
13258
13259
- const type = getDeclaredOrApparentType (getTypeOfSymbol(localOrExportSymbol), node);
13259
+ const type = getApparentTypeForLocation (getTypeOfSymbol(localOrExportSymbol), node);
13260
13260
const assignmentKind = getAssignmentTargetKind(node);
13261
13261
13262
13262
if (assignmentKind) {
@@ -15808,7 +15808,7 @@ namespace ts {
15808
15808
return unknownType;
15809
15809
}
15810
15810
}
15811
- propType = getDeclaredOrApparentType (getTypeOfSymbol(prop), node);
15811
+ propType = getApparentTypeForLocation (getTypeOfSymbol(prop), node);
15812
15812
}
15813
15813
// Only compute control flow type if this is a property access expression that isn't an
15814
15814
// assignment target, and the referenced property was declared as a variable, property,
0 commit comments