Closed
Description
TypeScript Version: 3.2.0-dev.20181019 and 3.1.3
Search Terms: function arguments count, spread, rest
Code
function foo(a: number, ...r: number[]): void { };
const a = [1];
foo(...a, 2); // Expected at least 1 arguments, but got 1 or more.
foo(...a, 2, 3); // Expected at least 1 arguments, but got 2 or more.
Expected behavior:
No errors
"at least 1" == "1 or more"
Actual behavior:
"at least 1" != "1 or more"
Non logical type error.
Playground Link: here
Related Issues:
#26350