Error message for invalid string literal type could be improved #10203
Labels
Domain: Error Messages
The issue relates to error messaging
Effort: Moderate
Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".
Experience Enhancement
Noncontroversial enhancements
Help Wanted
You can do this
Suggestion
An idea for TypeScript
Milestone
TypeScript Version: 2.0 Beta
Code
Expected behavior:
A more meaningful error message, e.g.
Argument of type "'bar'" is not assignable to parameter of type "'aa' | 'bb'|...|'last'"
Actual behavior:
Argument of type "'bar'" is not assignable to parameter of type "'last'"
I am finding this error message confusing, because the compiler picks the value of the last overload in order to report the error, and there is nothing special about the last value.
The text was updated successfully, but these errors were encountered: