mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-30 01:04:49 -05:00
Improve error message for overload that takes spread arguments
The original error message on the last line I have added to in
functionParameterArityMismatch.ts was
No overload expects 5 arguments, but overloads do exist that expect
either 4 or Infinity arguments.
even if we do not define a function that takes Infinity arguments.
This PR changes it to this:
Expected 0-6 arguments, but got 5 or more.
I feel it is still a bit strange but much more understandable.
Fixes #42418
This commit is contained in:
committed by
Eli Barzilay
parent
4fc9c8446d
commit
a3ead92046
@@ -12,3 +12,4 @@ f2(1);
|
||||
f2(1, 2, 3);
|
||||
f2(1, 2, 3, 4, 5);
|
||||
f2(1, 2, 3, 4, 5, 6, 7);
|
||||
f2(...[1], 2, 3, 4, 5, 6);
|
||||
|
||||
Reference in New Issue
Block a user