Closed
Description
TypeScript Version: 3.3.0-dev.20181121
Search Terms: js, javascript, A rest parameter must be of an array type
Code
//@ts-check
/** @type {(...bar: string[]) => void} */
function foo(...bar) {}
Expected behavior:
Doesn't report any errors. Type of bar
parameter is string[]
.
Actual behavior:
asdf.js:3:14 - error TS2370: A rest parameter must be of an array type.
3 function foo(...bar) {}
~~~~~~
Found 1 error.
VS Code intellisense shows bar
is string
instead of string[]
.
TypeScript 3.0.3 works as expected, 3.1.1 and later versions don't.