Elaborate array and tuple relation errors#30916
Merged
DanielRosenwasser merged 1 commit intomicrosoft:masterfrom Apr 15, 2019
Merged
Elaborate array and tuple relation errors#30916DanielRosenwasser merged 1 commit intomicrosoft:masterfrom
DanielRosenwasser merged 1 commit intomicrosoft:masterfrom
Conversation
7fa7c12 to
214c023
Compare
| mt = rt; // Error | ||
| ~~ | ||
| !!! error TS2740: Type 'readonly [string, string]' is missing the following properties from type '[string, string]': pop, push, reverse, shift, and 3 more. | ||
| !!! error TS4105: A 'readonly' tuple cannot be assigned to a mutable array-like type. |
Member
There was a problem hiding this comment.
Hmm, I think the fact that these lack context is a bit of a problem. If these aren't acting as elaborations, then maybe both messages could be replaced with
The type '{0}' is considered 'readonly' and cannot be assigned to the mutable type '{1}'.
Collaborator
Author
There was a problem hiding this comment.
Ah yes, it slipped past me that these errors don't include Foo is not assignable to Bar. So:
The type '{0}' is considered 'readonly' and cannot be assigned to the mutable type '{1}'.
which can probably subsume both new error messages?
Member
There was a problem hiding this comment.
Can we remove the word "considered" here?
Collaborator
Author
There was a problem hiding this comment.
Works for me!
214c023 to
2ea91a0
Compare
Member
|
Beautiful, thanks Jack! |
Collaborator
Author
|
Anytime! |
weswigham
added a commit
to weswigham/TypeScript
that referenced
this pull request
May 6, 2019
weswigham
added a commit
that referenced
this pull request
May 14, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #30839