File: genericFunctionsWithOptionalParameters2.errors.txt

package info (click to toggle)
node-typescript 3.3.3333-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 324,548 kB
  • sloc: makefile: 6; sh: 3
file content (18 lines) | stat: -rw-r--r-- 748 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
tests/cases/compiler/genericFunctionsWithOptionalParameters2.ts(7,1): error TS2554: Expected 1-3 arguments, but got 0.


==== tests/cases/compiler/genericFunctionsWithOptionalParameters2.ts (1 errors) ====
    interface Utils {
       fold<T, S>(c: Array<T>, folder?: (s: S, t: T) => T, init?: S): T;
    }
    
    var utils: Utils;
    
    utils.fold(); // error
    ~~~~~~~~~~~~
!!! error TS2554: Expected 1-3 arguments, but got 0.
!!! related TS6210 tests/cases/compiler/genericFunctionsWithOptionalParameters2.ts:2:15: An argument for 'c' was not provided.
    utils.fold(null); // no error
    utils.fold(null, null); // no error
    utils.fold(null, null, null); // error: Unable to invoke type with no call signatures