Commit a3ead92
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 microsoft#424181 parent 4fc9c84 commit a3ead92Copy full SHA for a3ead92
6 files changed
+32-4Lines changed: 32 additions & 4 deletions
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- src/compiler
- tests
- baselines/reference
- cases/compiler
Expand file treeCollapse file tree
Open diff view settings
Collapse file
+4-3Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
27709 | 27709 | |
27710 | 27710 | |
27711 | 27711 | |
| 27712 | + |
| 27713 | + |
| 27714 | + |
| 27715 | + |
27712 | 27716 | |
27713 | 27717 | |
27714 | 27718 | |
| ||
27742 | 27746 | |
27743 | 27747 | |
27744 | 27748 | |
27745 | | - |
27746 | | - |
27747 | | - |
27748 | 27749 | |
27749 | 27750 | |
27750 | 27751 | |
|
Collapse file
tests/baselines/reference/functionParameterArityMismatch.errors.txt
Copy file name to clipboardExpand all lines: tests/baselines/reference/functionParameterArityMismatch.errors.txt+5-1Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
5 | 5 | |
6 | 6 | |
7 | 7 | |
| 8 | + |
8 | 9 | |
9 | 10 | |
10 | | - |
| 11 | + |
11 | 12 | |
12 | 13 | |
13 | 14 | |
| ||
37 | 38 | |
38 | 39 | |
39 | 40 | |
| 41 | + |
| 42 | + |
| 43 | + |
40 | 44 | |
Collapse file
tests/baselines/reference/functionParameterArityMismatch.js
Copy file name to clipboardExpand all lines: tests/baselines/reference/functionParameterArityMismatch.js+7Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
13 | 13 | |
14 | 14 | |
15 | 15 | |
| 16 | + |
16 | 17 | |
17 | 18 | |
18 | 19 | |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
19 | 25 | |
20 | 26 | |
21 | 27 | |
22 | 28 | |
23 | 29 | |
24 | 30 | |
25 | 31 | |
| 32 | + |
Collapse file
tests/baselines/reference/functionParameterArityMismatch.symbols
Copy file name to clipboardExpand all lines: tests/baselines/reference/functionParameterArityMismatch.symbols+3Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
54 | 54 | |
55 | 55 | |
56 | 56 | |
| 57 | + |
| 58 | + |
| 59 | + |
Collapse file
tests/baselines/reference/functionParameterArityMismatch.types
Copy file name to clipboardExpand all lines: tests/baselines/reference/functionParameterArityMismatch.types+12Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
83 | 83 | |
84 | 84 | |
85 | 85 | |
| 86 | + |
| 87 | + |
| 88 | + |
| 89 | + |
| 90 | + |
| 91 | + |
| 92 | + |
| 93 | + |
| 94 | + |
| 95 | + |
| 96 | + |
| 97 | + |
Collapse file
tests/cases/compiler/functionParameterArityMismatch.ts
Copy file name to clipboardExpand all lines: tests/cases/compiler/functionParameterArityMismatch.ts+1Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
12 | 12 | |
13 | 13 | |
14 | 14 | |
| 15 | + |
0 commit comments