-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Skip qualification check when symbol is already in the process of being qualified #21337
Skip qualification check when symbol is already in the process of being qualified #21337
Conversation
…ocess of being qualified
08978ba
to
2b52fbd
Compare
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.
Couple of early comments, although I suspect I’ll need an in-person explanation even after I have a chance to look at this in the editor.
@@ -2424,12 +2424,15 @@ namespace ts { | |||
const visitedSymbolTables: SymbolTable[] = []; | |||
return forEachSymbolTableInScope(enclosingDeclaration, getAccessibleSymbolChainFromSymbolTable); | |||
|
|||
function getAccessibleSymbolChainFromSymbolTable(symbols: SymbolTable): Symbol[] | undefined { | |||
/** | |||
* @param {ignoreQualification} boolean Set when a symbol is being looked for through the exports of another symbol (meaning we have a route to qualify it already) |
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.
No types in jsdoc!
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.
How many calls are there to this function? Would it be horrible to make the new parameter required?
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.
It must remain optional because it's usage other than the direct call where it is set is in the callback position for forEachSymbolTableInScope
. We want to pass false
there anyway, so we keep is optional to avoid changing forEachSymbolTableInScope
or creating another closure.
@weswigham please port this change to release-2.7 as well. |
…ocess of being qualified (microsoft#21337)
Fixes #21313
This is needed because 1. we were doing work we didn't need to do (if the symbol was found via the exports of an accessible symbol, it is accessible via it), and 2. unconditionally doing so fails when symbols are present in multiple containers (since symbol.parent only points at the original container, which can be inaccessible even if the symbol is accessible via another container).