-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issueHelp WantedYou can do thisYou can do this
Milestone
Description
var [x, y] = [1];
The error is on y saying 'Type [number] has no property 1' which is not the most intuitive result. The more human readable explanation would be a span on either the full LHS or full RHS saying 'Tuple type [number] with length 1 cannot be assigned to a tuple type with length 2.'
Another:
var [x, [a,b]] = [[]];
The error is on the inner binding pattern [a,b] saying 'Type [undefined[]] has no property 1'. Again it would be much more understandable to error on the entire LHS or RHS saying 'Tuple type [undefined[]] with length 1 cannot be assigned to tuple type with length 2.'
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issueHelp WantedYou can do thisYou can do this