Skip to content

Commit

Permalink
Handle typeparameters as that will ensure we arent recording too many…
Browse files Browse the repository at this point in the history
… tracking symbols for recursive types
  • Loading branch information
sheetalkamat committed Oct 25, 2023
1 parent b395dbf commit 3684d8c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8877,7 +8877,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
}
if (context.trackedSymbols) {
if (!oldContext.trackedSymbols) oldContext.trackedSymbols = context.trackedSymbols;
else oldContext.trackedSymbols.push(...context.trackedSymbols);
else Debug.assert(context.trackedSymbols === oldContext.trackedSymbols);
}
context = oldContext;
}
Expand Down Expand Up @@ -50423,12 +50423,13 @@ class SymbolTrackerImpl implements SymbolTracker {
}

trackSymbol(symbol: Symbol, enclosingDeclaration: Node | undefined, meaning: SymbolFlags): boolean {
(this.context.trackedSymbols ??= []).push([symbol, enclosingDeclaration, meaning]);
if (this.inner?.trackSymbol && !this.disableTrackSymbol) {
if (this.inner.trackSymbol(symbol, enclosingDeclaration, meaning)) {
this.onDiagnosticReported();
return true;
}
// Skip recording type parameters as they dont contribute to late painted statements
if (!(symbol.flags & SymbolFlags.TypeParameter)) (this.context.trackedSymbols ??= []).push([symbol, enclosingDeclaration, meaning]);
}
return false;
}
Expand Down

0 comments on commit 3684d8c

Please sign in to comment.