mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
27 lines
1.1 KiB
Plaintext
27 lines
1.1 KiB
Plaintext
callOverload.ts(7,7): error TS2554: Expected 1 arguments, but got 4.
|
|
callOverload.ts(8,15): error TS2554: Expected 2 arguments, but got 4.
|
|
callOverload.ts(10,1): error TS2555: Expected at least 1 arguments, but got 0.
|
|
callOverload.ts(11,10): error TS2556: A spread argument must either have a tuple type or be passed to a rest parameter.
|
|
|
|
|
|
==== callOverload.ts (4 errors) ====
|
|
declare function fn(x: any): void;
|
|
declare function takeTwo(x: any, y: any): void;
|
|
declare function withRest(a: any, ...args: Array<any>): void;
|
|
declare var n: number[];
|
|
|
|
fn(1) // no error
|
|
fn(1, 2, 3, 4)
|
|
~~~~~~~
|
|
!!! error TS2554: Expected 1 arguments, but got 4.
|
|
takeTwo(1, 2, 3, 4)
|
|
~~~~
|
|
!!! error TS2554: Expected 2 arguments, but got 4.
|
|
withRest('a', ...n); // no error
|
|
withRest();
|
|
~~~~~~~~
|
|
!!! error TS2555: Expected at least 1 arguments, but got 0.
|
|
!!! related TS6210 callOverload.ts:3:27: An argument for 'a' was not provided.
|
|
withRest(...n);
|
|
~~~~
|
|
!!! error TS2556: A spread argument must either have a tuple type or be passed to a rest parameter. |