Files
TypeScript/src
Nathan Shively-Sanders 8657dc10a7 Error on excess spread arguments
Make the *technically* correct construction illegal:

```ts
declare function f(n: number): void;
declare var ns: number[];
f(1, ...ns);
```

This call only makes sense if `ns = []`, but in that case, why pass
`ns` at all? Allowing this call masks other errors when functions are
refactored to have fewer parameters, or to stop using rest parameters:

```ts
declare function old(...ns: number[]): void;
declare function new(ns: number | number[]): void;
old(1, ...ns); // Fine!
new(1, ...ns); // Should error!
```

This change the error for excess spread arguments to be more
understandable:

"Expected 3 arguments, but got least 4".

Previously the error would have been
"Expected 3 argument, but got at least 3", which is, again, technically
correct, but not understandable.
2017-11-16 09:31:50 -08:00
..
2017-11-16 09:31:50 -08:00