We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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[].
bar
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[].
string
TypeScript 3.0.3 works as expected, 3.1.1 and later versions don't.
The text was updated successfully, but these errors were encountered:
It appears to work if you use an @param tag, so there's always that workaround for now.
@param
Sorry, something went wrong.
This was fixed by #39473.
No branches or pull requests
TypeScript Version: 3.3.0-dev.20181121
Search Terms: js, javascript, A rest parameter must be of an array type
Code
Expected behavior:
Doesn't report any errors. Type of
bar
parameter isstring[]
.Actual behavior:
VS Code intellisense shows
bar
isstring
instead ofstring[]
.TypeScript 3.0.3 works as expected, 3.1.1 and later versions don't.
The text was updated successfully, but these errors were encountered: