Always consider parameters in scope visible to node builder#58075
Merged
weswigham merged 7 commits intomicrosoft:mainfrom Apr 4, 2024
Merged
Always consider parameters in scope visible to node builder#58075weswigham merged 7 commits intomicrosoft:mainfrom
weswigham merged 7 commits intomicrosoft:mainfrom
Conversation
weswigham
commented
Apr 4, 2024
tests/baselines/reference/cyclicGenericTypeInstantiationInference.types
Outdated
Show resolved
Hide resolved
src/compiler/checker.ts
Outdated
| sym.flags & SymbolFlags.FunctionScopedVariable | ||
| && sym.valueDeclaration | ||
| ) { | ||
| const parameter = sym.valueDeclaration && isParameterDeclaration(sym.valueDeclaration); |
Contributor
There was a problem hiding this comment.
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.
Member
Author
There was a problem hiding this comment.
The confusingly-named isParameterDeclaration does not do what you think it does - it does walk binding elements.
Member
There was a problem hiding this comment.
Yeah, we should really rename that to isPartOfParameterDeclaration. See also #52283
…depends on this and otherwise has no baseline diffs
jakebailey
approved these changes
Apr 4, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.