mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
27 lines
1.4 KiB
Plaintext
27 lines
1.4 KiB
Plaintext
genericFunctionsWithOptionalParameters2.ts(7,7): error TS2554: Expected 1-3 arguments, but got 0.
|
|
genericFunctionsWithOptionalParameters2.ts(8,12): error TS2345: Argument of type 'null' is not assignable to parameter of type 'unknown[]'.
|
|
genericFunctionsWithOptionalParameters2.ts(9,12): error TS2345: Argument of type 'null' is not assignable to parameter of type 'unknown[]'.
|
|
genericFunctionsWithOptionalParameters2.ts(10,12): error TS2345: Argument of type 'null' is not assignable to parameter of type 'unknown[]'.
|
|
|
|
|
|
==== genericFunctionsWithOptionalParameters2.ts (4 errors) ====
|
|
interface Utils {
|
|
fold<T, S>(c: Array<T>, folder?: (s: S, t: T) => T, init?: S): T;
|
|
}
|
|
|
|
declare var utils: Utils;
|
|
|
|
utils.fold(); // error
|
|
~~~~
|
|
!!! error TS2554: Expected 1-3 arguments, but got 0.
|
|
!!! related TS6210 genericFunctionsWithOptionalParameters2.ts:2:15: An argument for 'c' was not provided.
|
|
utils.fold(null); // no error
|
|
~~~~
|
|
!!! error TS2345: Argument of type 'null' is not assignable to parameter of type 'unknown[]'.
|
|
utils.fold(null, null); // no error
|
|
~~~~
|
|
!!! error TS2345: Argument of type 'null' is not assignable to parameter of type 'unknown[]'.
|
|
utils.fold(null, null, null); // error: Unable to invoke type with no call signatures
|
|
~~~~
|
|
!!! error TS2345: Argument of type 'null' is not assignable to parameter of type 'unknown[]'.
|
|
|