File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -34523,6 +34523,8 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
3452334523 }
3452434524 return getRegularTypeOfLiteralType(exprType);
3452534525 }
34526+ const links = getNodeLinks(node);
34527+ links.assertionExpressionType = exprType;
3452634528 checkSourceElement(type);
3452734529 checkNodeDeferred(node);
3452834530 return getTypeFromTypeNode(type);
@@ -34547,9 +34549,11 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
3454734549 }
3454834550
3454934551 function checkAssertionDeferred(node: JSDocTypeAssertion | AssertionExpression) {
34550- const { type, expression } = getAssertionTypeAndExpression(node);
34552+ const { type } = getAssertionTypeAndExpression(node);
3455134553 const errNode = isParenthesizedExpression(node) ? type : node;
34552- const exprType = getRegularTypeOfObjectLiteral(getBaseTypeOfLiteralType(checkExpression(expression)));
34554+ const links = getNodeLinks(node);
34555+ Debug.assertIsDefined(links.assertionExpressionType);
34556+ const exprType = getRegularTypeOfObjectLiteral(getBaseTypeOfLiteralType(links.assertionExpressionType));
3455334557 const targetType = getTypeFromTypeNode(type);
3455434558 if (!isErrorType(targetType)) {
3455534559 addLazyDiagnostic(() => {
Original file line number Diff line number Diff line change @@ -6060,6 +6060,7 @@ export interface NodeLinks {
60606060 spreadIndices ?: { first : number | undefined , last : number | undefined } ; // Indices of first and last spread elements in array literal
60616061 parameterInitializerContainsUndefined ?: boolean ; // True if this is a parameter declaration whose type annotation contains "undefined".
60626062 fakeScopeForSignatureDeclaration ?: boolean ; // True if this is a fake scope injected into an enclosing declaration chain.
6063+ assertionExpressionType ?: Type ; // Cached type of the expression of a type assertion
60636064}
60646065
60656066/** @internal */
You can’t perform that action at this time.
0 commit comments