mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-24 11:43:18 -05:00
Get narrowable types for new expressions (#57382)
This commit is contained in:
committed by
GitHub
parent
f23927a806
commit
63dd17baef
@@ -29071,6 +29071,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
return parent.kind === SyntaxKind.PropertyAccessExpression ||
|
||||
parent.kind === SyntaxKind.QualifiedName ||
|
||||
parent.kind === SyntaxKind.CallExpression && (parent as CallExpression).expression === node ||
|
||||
parent.kind === SyntaxKind.NewExpression && (parent as NewExpression).expression === node ||
|
||||
parent.kind === SyntaxKind.ElementAccessExpression && (parent as ElementAccessExpression).expression === node &&
|
||||
!(someType(type, isGenericTypeWithoutNullableConstraint) && isGenericIndexType(getTypeOfExpression((parent as ElementAccessExpression).argumentExpression)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user