Skip to content
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

got n or more with spread arguments #20372

Closed
falsandtru opened this issue Nov 30, 2017 · 1 comment
Closed

got n or more with spread arguments #20372

falsandtru opened this issue Nov 30, 2017 · 1 comment
Labels
Bug A bug in TypeScript Domain: Error Messages The issue relates to error messaging Help Wanted You can do this
Milestone

Comments

@falsandtru
Copy link
Contributor

@sandersn Provide consistent messages?

TypeScript Version: master

Code

declare function f(): void;
f(...[]);
declare function g(): void;
declare function g(a: void): void;
g(...[]);
declare function h(a: void): void;
declare function h(a: void): void;
h(...[]);

Expected behavior:

#20097 (comment)

Actual behavior:

$ node built/local/tsc.js index.ts
index.ts(2,1): error TS2556: Expected 0 arguments, but got 1 or more.
index.ts(5,1): error TS2556: Expected 0-1 arguments, but got 0 or more.
index.ts(8,1): error TS2556: Expected 1 arguments, but got 0 or more.
@jakebailey
Copy link
Member

All of thee calls are now legal as of #52845. Playground Link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: Error Messages The issue relates to error messaging Help Wanted You can do this
Projects
None yet
Development

No branches or pull requests

4 participants