Skip to content

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
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
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
Archived in project
Development

Successfully merging this pull request may close these issues.

Conditional type simplified too early
6 participants