-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
spread error when using tuples within overload signatures #54812
Comments
Essentially a duplicate of #14107 |
Even if this continues to be an error, the message is pretty confusing. "A spread argument must either have a tuple type or be passed to a rest parameter"… but (I guess pedantically-speaking a union of tuple types is not "a tuple type", and arguably a rest parameter with a fixed length isn't a "real" rest parameter. But removing the overload signatures makes this error go away, so neither of those things are really the problem here.) I think ideally the error message would say something about |
Fun fact, this isn’t just a “no true Scotsman” quibble - IIRC TS sees no difference between That said, I’ve agreed for a while that the wording of this error message is confusing in many of the cases where it shows up. |
Agreed; if someone wants to update the error message that'd be fine |
This issue has been marked as "Duplicate" and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
Bug Report
🔎 Search Terms
⏯ Playground Link
Playground link with relevant code
💻 Code
🙁 Actual behavior
Type Error:
🙂 Expected behavior
No type errors. All resolutions of the
AB
union are valid tuples and should be spreadable.The text was updated successfully, but these errors were encountered: