Skip to content

Constrain infer type parameters made to preserve distributivity for … #49793

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

Conversation

weswigham
Copy link
Member

…inlined homomorphic mapped types

After multiple levels of inlinings, constraints can be lost when they're not carried forward because of a semi-circular (not directly circular by our detection logic, but definitely self-referential in a deferred way) type parameter constraint. By going back to the original declaration and copying that type parameter's constraint forward into the infer type we're making, we can avoid losing the constraint information in the declaration file.

Fixes #49591

@typescript-bot typescript-bot added Author: Team For Milestone Bug PRs that fix a bug with a specific milestone labels Jul 5, 2022
@weswigham weswigham changed the title Constrain infer type parameters made to preserver distributivity for … Constrain infer type parameters made to preserve distributivity for … Jul 6, 2022
@weswigham weswigham merged commit 0f86803 into microsoft:main Jul 6, 2022
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
None yet
Development

Successfully merging this pull request may close these issues.

Invalid declarations for inlined distributive types in 4.7
3 participants