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.0.0-dev.20180628
Search Terms:
Code
declare function take(cb: (a: number, b: string) => void): void; /*1*/ (function foo(...rest){}(1, '')); /*2*/ take(function(...rest){});
Expected behavior:
In both functions rest should be inferred as [number, string].
rest
[number, string]
Actual behavior:
1: rest in IIFE is inferred as (string | number)[]. 2: rest is inferred as any[] and emits implicit any error.
(string | number)[]
any[]
Related Issues:
The text was updated successfully, but these errors were encountered:
Agreed, we should infer a tuple type in both cases above.
Sorry, something went wrong.
ahejlsberg
No branches or pull requests
TypeScript Version: 3.0.0-dev.20180628
Search Terms:
Code
Expected behavior:
In both functions
rest
should be inferred as[number, string]
.Actual behavior:
1:
rest
in IIFE is inferred as(string | number)[]
.2:
rest
is inferred asany[]
and emits implicit any error.Related Issues:
The text was updated successfully, but these errors were encountered: