-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Open
Labels
Fix AvailableA PR has been opened for this issueA PR has been opened for this issueHelp WantedYou can do thisYou can do thisPossible ImprovementThe current behavior isn't wrong, but it's possible to see that it might be better in some casesThe current behavior isn't wrong, but it's possible to see that it might be better in some cases
Milestone
Description
π Search Terms
double error, same message twice, ambient declaration, string literal union
π Version & Regression Information
This changed between versions 3.9.7 and 4.0.5
β― Playground Link
π» Code
declare const x: "a" | "b"
const y: number = x
// ~
// Type 'string' is not assignable to type 'number'.
// Type 'string' is not assignable to type 'number'. (2322)π Actual behavior
You see same error message twice
π Expected behavior
The error message should be the one in 3.9.7 ie...
Type '"a" | "b"' is not assignable to type 'number'.
Type '"a"' is not assignable to type 'number'. (2322)
Or the following message just once also works...
Type 'string' is not assignable to type 'number'. (2322)
Additional information about the issue
No response
Metadata
Metadata
Assignees
Labels
Fix AvailableA PR has been opened for this issueA PR has been opened for this issueHelp WantedYou can do thisYou can do thisPossible ImprovementThe current behavior isn't wrong, but it's possible to see that it might be better in some casesThe current behavior isn't wrong, but it's possible to see that it might be better in some cases