-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
DuplicateAn existing issue was already createdAn existing issue was already createdIn DiscussionNot yet reached consensusNot yet reached consensusSuggestionAn idea for TypeScriptAn idea for TypeScript
Description
I have a piece of code as is:
function add(a: number, b: number, c: number) {
return a + b + c;
}
const hexagons = [1, 6, 15];
const result = add(...hexagons);
And VS Code complains about:
[ts] Expected 3 arguments, but got 0 or more.
I haven't found if it is necessary to set some config option or this is a bug in the VSCode TS parser itself.
But it is valid code in Chrome:
function add(a, b, c) {
return a + b + c;
}
const hexagons = [1, 6, 15];
const result = add(...hexagons);
So I think VSCode is wrongly parsing TS.
menocomp
Metadata
Metadata
Assignees
Labels
DuplicateAn existing issue was already createdAn existing issue was already createdIn DiscussionNot yet reached consensusNot yet reached consensusSuggestionAn idea for TypeScriptAn idea for TypeScript