-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Fixed an accidental undefined
leak into getAccessibleSymbolChain
's cache key
#58669
Fixed an accidental undefined
leak into getAccessibleSymbolChain
's cache key
#58669
Conversation
This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise. |
@@ -5473,7 +5473,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { | |||
const cache = (links.accessibleChainCache ||= new Map()); | |||
// Go from enclosingDeclaration to the first scope we check, so the cache is keyed off the scope and thus shared more | |||
const firstRelevantLocation = forEachSymbolTableInScope(enclosingDeclaration, (_, __, ___, node) => node); | |||
const key = `${useOnlyExternalAliasing ? 0 : 1}|${firstRelevantLocation && getNodeId(firstRelevantLocation)}|${meaning}`; | |||
const key = `${useOnlyExternalAliasing ? 0 : 1}|${firstRelevantLocation ? getNodeId(firstRelevantLocation) : 0}|${meaning}`; |
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.
I noticed that those keys could look smth like '0|undefined|788968'
(I spotted an instance of that in the debugger). It bugged me enough to create this PR ;p
0 should be a safe fallback here as the lowest possible node id is 1
@typescript-bot test it Double checking this isn't depended on accidentally. |
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! |
@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! |
No description provided.