Skip to content

Probably improper error message when dealing with spread operator #5189

New issue

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

Closed
barcicki opened this issue Oct 9, 2015 · 1 comment
Closed

Probably improper error message when dealing with spread operator #5189

barcicki opened this issue Oct 9, 2015 · 1 comment
Labels
Duplicate An existing issue was already created

Comments

@barcicki
Copy link

barcicki commented Oct 9, 2015

Consider following example:

console.log(...['Hello', 'world']);

It's a completely valid console.log usage scenario however TypeScript (@1.6.2) raises TS2346 error: Supplied parameters do not match any signature of call target.

The log's signature is:

declare function log(message?: any, ...optionalParams: any[]);

Therefore following code:

console.log('Hello', ...['world']);

is considered valid, without any errors.

In my opinion the top example should not trigger any errors.

@DanielRosenwasser
Copy link
Member

Thanks for filing the issue - this looks like a duplicate of #4755. The issue to appropriately address this is tracked by #4759.

@DanielRosenwasser DanielRosenwasser added the Duplicate An existing issue was already created label Oct 9, 2015
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

2 participants