Skip to content

Unnecessary elaboration about not being assignable to type parameters #42952

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 1 commit into from
Mar 5, 2021

Conversation

jonhue
Copy link
Contributor

@jonhue jonhue commented Feb 25, 2021

Fixes #42849

@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label Feb 25, 2021
Comment on lines 46 to -49
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
Type 'Base' is not assignable to type 'T'.
'T' could be instantiated with an arbitrary type which could be unrelated to 'Base'.
Copy link
Contributor Author

@jonhue jonhue Feb 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing which I'm not 100% certain about based on the original issue, is whether we want to continue elaborating if the target and source type are the same. Like in this case where both are T. What do you think?

Theoretically, we could also be even more conservative by only stopping elaboration when the target is some type parameter (e.g. T) and the source is a union of that type parameter and something else (e.g. T | SomeOtherType).

@sandersn sandersn requested a review from weswigham March 4, 2021 15:00
@weswigham weswigham merged commit 25375a2 into microsoft:master Mar 5, 2021
@jonhue jonhue deleted the fix-42849 branch March 7, 2021 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Backlog Bug PRs that fix a backlog bug
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Unnecessary elaboration about not being assignable to type parameters
3 participants