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

Ensure distributive constraints of restrictive instantiations of type parameters don't exist #47091

Conversation

weswigham
Copy link
Member

Since restrictive instantiations replace type parameter constraints with unknown, if we use them to calculate a distributive constraint, we produce very wrong results. So we try to see if we're looking at such an instantiation when calculating a distributive constraint now, and choose to not yield a constraint if that is the case.

Fixes #46761

@typescript-bot typescript-bot added Author: Team For Milestone Bug PRs that fix a bug with a specific milestone labels Dec 9, 2021
@fatcerberus
Copy link

What is a "restrictive instantiation"? #46761 doesn't mention that term, and I've personally never heard of it. Is it some kind of internal implementation detail?

@weswigham
Copy link
Member Author

It's definitely an implementation detail. It's part of how we check if no instantiation of one thing is assignable to another thing.

@sandersn sandersn added this to Not started in PR Backlog via automation Jan 31, 2022
@sandersn sandersn moved this from Not started to Waiting on reviewers in PR Backlog Jan 31, 2022
PR Backlog automation moved this from Waiting on reviewers to Needs merge Sep 27, 2022
@sandersn
Copy link
Member

@weswigham I'm going through all the ready-to-merge PRs, and this one is signed off. Is it worth bringing up to date and merging it for 5.1?

@jakebailey
Copy link
Member

Apparently the linked issue was fixed in #50397.

PR for just the test is here: #53067

@sandersn
Copy link
Member

sandersn commented Mar 3, 2023

All right, this is old and looks like it's obsolete, so I'm going to close it.

@sandersn sandersn closed this Mar 3, 2023
PR Backlog automation moved this from Needs merge to Done Mar 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Milestone Bug PRs that fix a bug with a specific milestone
Projects
PR Backlog
  
Done
Development

Successfully merging this pull request may close these issues.

Conditional type simplified too early
6 participants