diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index acc0666333e4f..3c6217180981a 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1868,7 +1868,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { const nodeLinks = getNodeLinks(node); cachedResolvedSignatures.push([nodeLinks, nodeLinks.resolvedSignature] as const); nodeLinks.resolvedSignature = undefined; - if (isFunctionLikeDeclaration(node)) { + if (isFunctionExpressionOrArrowFunction(node)) { const symbolLinks = getSymbolLinks(getSymbolOfDeclaration(node)); const type = symbolLinks.type; cachedTypes.push([symbolLinks, type] as const); diff --git a/src/compiler/utilitiesPublic.ts b/src/compiler/utilitiesPublic.ts index b7cdef568277c..688ef16272039 100644 --- a/src/compiler/utilitiesPublic.ts +++ b/src/compiler/utilitiesPublic.ts @@ -5,6 +5,7 @@ import { ArrayBindingElement, ArrayBindingOrAssignmentElement, ArrayBindingOrAssignmentPattern, + ArrowFunction, AssertionExpression, AssignmentDeclarationKind, AssignmentPattern, @@ -64,6 +65,7 @@ import { ForInitializer, ForInOrOfStatement, FunctionBody, + FunctionExpression, FunctionLikeDeclaration, FunctionTypeNode, GeneratedIdentifier, @@ -119,6 +121,7 @@ import { isExportSpecifier, isFunctionBlock, isFunctionExpression, + isFunctionExpressionOrArrowFunction, isFunctionTypeNode, isIdentifier, isImportSpecifier, @@ -1928,8 +1931,8 @@ export function isPropertyAccessOrQualifiedName(node: Node): node is PropertyAcc } /** @internal */ -export function isCallLikeOrFunctionLikeExpression(node: Node): node is CallLikeExpression | FunctionLikeDeclaration { - return isCallLikeExpression(node) || isFunctionLikeDeclaration(node); +export function isCallLikeOrFunctionLikeExpression(node: Node): node is CallLikeExpression | FunctionExpression | ArrowFunction { + return isCallLikeExpression(node) || isFunctionExpressionOrArrowFunction(node); } export function isCallLikeExpression(node: Node): node is CallLikeExpression {