Skip to content

Commit 5eb3137

Browse files
committed
Revert "just don't try to reuse anything in the blocked file as it's too error-prone"
This reverts commit a3ce662.
1 parent a3ce662 commit 5eb3137

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/compiler/checker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2904,7 +2904,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
29042904
function getSymbolLinks(symbol: Symbol): SymbolLinks {
29052905
if (symbol.flags & SymbolFlags.Transient) return (symbol as TransientSymbol).links;
29062906
const id = getSymbolId(symbol);
2907-
if (sourceFileWithoutResolvedSignatureCaching && symbol.valueDeclaration && getSourceFileOfNode(symbol.valueDeclaration) === sourceFileWithoutResolvedSignatureCaching) {
2907+
if (sourceFileWithoutResolvedSignatureCaching && symbol.valueDeclaration && (isFunctionExpressionOrArrowFunction(symbol.valueDeclaration) || tryGetRootParameterDeclaration(symbol.valueDeclaration)) && getSourceFileOfNode(symbol.valueDeclaration) === sourceFileWithoutResolvedSignatureCaching) {
29082908
symbolLinksWithoutResolvedSignatureCaching ??= [];
29092909
return symbolLinksWithoutResolvedSignatureCaching[id] ??= new SymbolLinks();
29102910
}
@@ -2913,7 +2913,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
29132913

29142914
function getNodeLinks(node: Node): NodeLinks {
29152915
const nodeId = getNodeId(node);
2916-
if (sourceFileWithoutResolvedSignatureCaching && getSourceFileOfNode(node) === sourceFileWithoutResolvedSignatureCaching) {
2916+
if (sourceFileWithoutResolvedSignatureCaching && (isCallLikeOrFunctionLikeExpression(node) || tryGetRootParameterDeclaration(node)) && getSourceFileOfNode(node) === sourceFileWithoutResolvedSignatureCaching) {
29172917
nodeLinksWithoutResolvedSignatureCaching ??= [];
29182918
return nodeLinksWithoutResolvedSignatureCaching[nodeId] ??= new (NodeLinks as any)();
29192919
}

0 commit comments

Comments
 (0)