Skip to content
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

Adjust the node builder compatible reference check to handle aliased tuples #58066

Merged
merged 2 commits into from
Apr 3, 2024

Conversation

weswigham
Copy link
Member

This check is needed to handle checking if the input node actually meets the required argument count for the target type (since in JS you can construct a type with fewer type arguments than required and you just get anys for the missing ones, and even in TS if the input has errors). Oddly enough, though, the way tuples are constructed can mean you have a reference node (for the alias) that points at another reference type (for the actual tuple) which have different type argument lists. As-is, this was disqualifying all cases like that (an alias of a tuple) from reuse (unless, by chance, the alias had the same argument count as the target tuple).

@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Apr 3, 2024
@weswigham weswigham merged commit 565006c into microsoft:main Apr 3, 2024
25 checks passed
@weswigham weswigham deleted the better-compatible-ref-check branch April 3, 2024 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants