-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Always consider parameters in scope visible to node builder #58075
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
Always consider parameters in scope visible to node builder #58075
Conversation
tests/baselines/reference/cyclicGenericTypeInstantiationInference.types
Outdated
Show resolved
Hide resolved
sym.flags & SymbolFlags.FunctionScopedVariable | ||
&& sym.valueDeclaration | ||
) { | ||
const parameter = sym.valueDeclaration && isParameterDeclaration(sym.valueDeclaration); |
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.
The problem is that this will not work for binding elements. The original check was mean to walk up the binding elements. I this i lost something when I copied it over.
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.
The confusingly-named isParameterDeclaration
does not do what you think it does - it does walk binding elements.
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.
Yeah, we should really rename that to isPartOfParameterDeclaration
. See also #52283
…depends on this and otherwise has no baseline diffs
Parameter symbols in scope resolve, thanks to recent changes, but don't always have a visible declaration (if their host signature isn't directly exported) - this doesn't matter in the node builder, since we're cloning that host signature in some way anyway, so if it's a parameter and we're looking at it, it aughta be visible.