-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Clear out checker-level stacks on pop #62016
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR ensures that stack-based contextual types, inference contexts, and active mapper caches are explicitly cleared when popping to avoid holding onto stale references and potential memory leaks.
- Clear references in
popContextualType
andpopInferenceContext
- Adjust
pushActiveMapper
to reuse existing cache maps with??=
- Clear mapper entries and cache contents in
popActiveMapper
Comments suppressed due to low confidence (2)
@typescript-bot test it |
Hey @jakebailey, the results of running the DT tests are ready. Everything looks the same! |
@jakebailey Here are the results of running the user tests with tsc comparing Everything looks good! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I like to use undefined!
in these situations but as any
is just as good.
Oh, oops, that's the incantation I meant to use. |
Need a re-review now, sorry; I definitely meant |
@jakebailey Here they are:
tscComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
@jakebailey Here are the results of running the top 400 repos with tsc comparing Everything looks good! |
These global-ish stacks left their references behind on pop. If the contents are ephemeral (sometimes happens with types, mappers), they'll be held indefinitely.
See also: