mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 16:38:05 -06:00
Skip CFA on obj[key] where key isn't a known property name
This commit is contained in:
parent
9866640f92
commit
e74dd02e08
@ -33183,6 +33183,9 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
return getFlowTypeOfProperty(node, prop);
|
||||
}
|
||||
propType = getNarrowableTypeForReference(propType, node, checkMode);
|
||||
if (isElementAccessExpression(node) && !tryGetElementAccessExpressionName(node)) {
|
||||
return propType;
|
||||
}
|
||||
// If strict null checks and strict property initialization checks are enabled, if we have
|
||||
// a this.xxx property access, if the property is an instance property without an initializer,
|
||||
// and if we are in a constructor of the same class as the property declaration, assume that
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user