Skip to content

Commit 8e492d6

Browse files
sheetalkamatjakebailey
authored andcommitted
Track symbols per type thats cached and dont keep adding to them (#56421)
Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com>
1 parent 9bb38b7 commit 8e492d6

File tree

5 files changed

+2652
-0
lines changed

5 files changed

+2652
-0
lines changed

src/compiler/checker.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6949,6 +6949,8 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
69496949
context.symbolDepth!.set(id, depth + 1);
69506950
}
69516951
context.visitedTypes.add(typeId);
6952+
const prevTrackedSymbols = context.trackedSymbols;
6953+
context.trackedSymbols = undefined;
69526954
const startLength = context.approximateLength;
69536955
const result = transform(type);
69546956
const addedLength = context.approximateLength - startLength;
@@ -6964,6 +6966,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
69646966
if (id) {
69656967
context.symbolDepth!.set(id, depth!);
69666968
}
6969+
context.trackedSymbols = prevTrackedSymbols;
69676970
return result;
69686971

69696972
function deepCloneOrReuseNode<T extends Node>(node: T): T {

0 commit comments

Comments
 (0)