Skip to content

Allow intersections of readonlys to be assignable to a readonly intersection #28218

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

Merged
merged 2 commits into from
Oct 31, 2018

Conversation

weswigham
Copy link
Member

Since #12351 we've been checking getConstraintTypeFromMappedType(target) === getIndexType(source) - the rule is in reality able to be relaxed a bit more than that. It's acceptable for the source to have more keys than the target, so long as it still provides for every key in target (and that S is still assignable to T's template).

Fixes #27484

@weswigham weswigham merged commit 3a2f7c0 into microsoft:master Oct 31, 2018
@weswigham weswigham deleted the homomorphic-intersections branch October 31, 2018 21:09
weswigham added a commit to weswigham/TypeScript that referenced this pull request Nov 6, 2018
weswigham added a commit that referenced this pull request Nov 6, 2018
ghost pushed a commit that referenced this pull request Nov 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants