Skip to content

Commit

Permalink
Tighten checks even more
Browse files Browse the repository at this point in the history
  • Loading branch information
Andarist committed Oct 30, 2023
1 parent 8c4fae6 commit 0009f7f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
7 changes: 5 additions & 2 deletions src/compiler/utilitiesPublic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
ArrayBindingElement,
ArrayBindingOrAssignmentElement,
ArrayBindingOrAssignmentPattern,
ArrowFunction,
AssertionExpression,
AssignmentDeclarationKind,
AssignmentPattern,
Expand Down Expand Up @@ -64,6 +65,7 @@ import {
ForInitializer,
ForInOrOfStatement,
FunctionBody,
FunctionExpression,
FunctionLikeDeclaration,
FunctionTypeNode,
GeneratedIdentifier,
Expand Down Expand Up @@ -119,6 +121,7 @@ import {
isExportSpecifier,
isFunctionBlock,
isFunctionExpression,
isFunctionExpressionOrArrowFunction,
isFunctionTypeNode,
isIdentifier,
isImportSpecifier,
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 0009f7f

Please sign in to comment.