File: functionParameterArityMismatch.errors.txt

package info (click to toggle)
node-typescript 5.0.4%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 459,140 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (44 lines) | stat: -rw-r--r-- 2,729 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
tests/cases/compiler/functionParameterArityMismatch.ts(3,1): error TS2554: Expected 1-3 arguments, but got 0.
tests/cases/compiler/functionParameterArityMismatch.ts(4,1): error TS2575: No overload expects 2 arguments, but overloads do exist that expect either 1 or 3 arguments.
tests/cases/compiler/functionParameterArityMismatch.ts(5,13): error TS2554: Expected 1-3 arguments, but got 4.
tests/cases/compiler/functionParameterArityMismatch.ts(11,1): error TS2575: No overload expects 1 arguments, but overloads do exist that expect either 0 or 2 arguments.
tests/cases/compiler/functionParameterArityMismatch.ts(12,1): error TS2575: No overload expects 3 arguments, but overloads do exist that expect either 2 or 4 arguments.
tests/cases/compiler/functionParameterArityMismatch.ts(13,1): error TS2575: No overload expects 5 arguments, but overloads do exist that expect either 4 or 6 arguments.
tests/cases/compiler/functionParameterArityMismatch.ts(14,22): error TS2554: Expected 0-6 arguments, but got 7.
tests/cases/compiler/functionParameterArityMismatch.ts(15,4): error TS2556: A spread argument must either have a tuple type or be passed to a rest parameter.


==== tests/cases/compiler/functionParameterArityMismatch.ts (8 errors) ====
    declare function f1(a: number);
    declare function f1(a: number, b: number, c: number);
    f1();
    ~~~~
!!! error TS2554: Expected 1-3 arguments, but got 0.
!!! related TS6210 tests/cases/compiler/functionParameterArityMismatch.ts:1:21: An argument for 'a' was not provided.
    f1(1, 2);
    ~~~~~~~~
!!! error TS2575: No overload expects 2 arguments, but overloads do exist that expect either 1 or 3 arguments.
    f1(1, 2, 3, 4);
                ~
!!! error TS2554: Expected 1-3 arguments, but got 4.
    
    declare function f2();
    declare function f2(a: number, b: number);
    declare function f2(a: number, b: number, c: number, d: number);
    declare function f2(a: number, b: number, c: number, d: number, e: number, f: number);
    f2(1);
    ~~~~~
!!! error TS2575: No overload expects 1 arguments, but overloads do exist that expect either 0 or 2 arguments.
    f2(1, 2, 3);
    ~~~~~~~~~~~
!!! error TS2575: No overload expects 3 arguments, but overloads do exist that expect either 2 or 4 arguments.
    f2(1, 2, 3, 4, 5);
    ~~~~~~~~~~~~~~~~~
!!! error TS2575: No overload expects 5 arguments, but overloads do exist that expect either 4 or 6 arguments.
    f2(1, 2, 3, 4, 5, 6, 7);
                         ~
!!! error TS2554: Expected 0-6 arguments, but got 7.
    f2(...[1], 2, 3, 4, 5, 6);
       ~~~~~~
!!! error TS2556: A spread argument must either have a tuple type or be passed to a rest parameter.