Poor error message elaborations for array-like types #30839
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
Fixed
A PR has been merged for this issue
Help Wanted
You can do this
Milestone
This is bad to show to beginners. Here's a few things we could be doing better.
If a source type is a
ReadonlyArray
(for allE
), and a target type is anArray
, then give a specialized error message thatReadonlyArray
s can't be assigned toArray
s.If the source type is a
readonly
tuple, and the target is a plain tuple or array-like type...If one side is a tuple type, and the other isn't array-like, just don't elaborate at all. Nobody cares about missing
push
,pop
, and 6 other members...The text was updated successfully, but these errors were encountered: