Confusing error messages: expected N arguments #42891
Labels
Bug
A bug in TypeScript
Domain: Error Messages
The issue relates to error messaging
Effort: Moderate
Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".
Fix Available
A PR has been opened for this issue
Help Wanted
You can do this
Milestone
Bug Report
π Search Terms
error, arguments, overloads
β― Playground Link
Playground link with relevant code
π» Code
Reduced from https://github.com/elibarzilay/process-tracing/blob/59a790c839258ee737481edad0a614f094a1d68c/index.js
There are several weird things going on here:
fs.createWriteStream(output)
is squiggled and the error produced isExpected at least 1 arguments, but got 6 or more.
There are no elaborations. I have no idea what's actually wrong.async function *
argument, the new error isNo overload expects 4 arguments, but overloads do exist that expect either 4 or Infinity arguments.
The phrasing "4 or Infinity" is strange, the value 4 is both expected and not expected, and it's not clear where 4 actually comes from (maybe it assumes each spread is empty?).Expected at least 1 arguments, but got 4 or more.
The text was updated successfully, but these errors were encountered: