* 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
10 lines
No EOL
425 B
TypeScript
10 lines
No EOL
425 B
TypeScript
declare function takeTwo(a: string, b: string): void;
|
|
declare const t2: [string, string];
|
|
declare const t3: [string, string, string];
|
|
|
|
takeTwo('a', ...t2); // error on ...t2
|
|
takeTwo('a', 'b', 'c', ...t2); // error on 'c' and ...t2
|
|
takeTwo('a', 'b', ...t2, 'c'); // error on ...t2 and 'c'
|
|
takeTwo('a', 'b', 'c', ...t2, 'd'); // error on 'c', ...t2 and 'd'
|
|
takeTwo(...t2, 'a'); // error on 'a'
|
|
takeTwo(...t3); // error on ...t3
|