TypeScript/tests/cases/conformance/expressions/functionCalls/callOverload.ts
Collins Abitekaniza 7b55d1846b Giving too many arguments should error on the first argument that exceeds arity (#27982)
* span on first arg that exceeds arity

* refactor baseline

* handle cases for spread arguments

* refactor + add coverage for tuple spread cases

* create diagnostic on NodeArray of exceeding args

* test function overloading
2019-03-12 15:57:12 -07:00

11 lines
No EOL
277 B
TypeScript

declare function fn(x: any): void;
declare function takeTwo(x: any, y: any): void;
declare function withRest(a: any, ...args: Array<any>): void;
var n: number[];
fn(1) // no error
fn(1, 2, 3, 4)
takeTwo(1, 2, 3, 4)
withRest('a', ...n); // no error
withRest();
withRest(...n);