-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Lib: args rest type should always be array of any #36327
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
Comments
Why is this an issue ? |
I experimented with mixin factories and got signature mismatch of my
As I understand |
@antongolub Maybe post a self contained example reproducing the issue? |
Well, once I tried to localize problem point, I've found accidental iface and variable names clash. interface D {
}
// ~200 lines of code
const D = ... This made a major contribution to my problem. type InstanceType<T> = T extends new (...args: any[]) => infer R ? R : any;
interface Foo { foo: string }
interface WeirdConstructable {
new (...args: never): Foo
}
const instance: InstanceType<WeirdConstructable> = { foo: 1 } // $ExpectError |
TypeScript Version: 3.8.0-dev.20200119
Search Terms: rest, ConstructorParameters, ReturnType
Code
Expected behavior:
...args
rest param should extendany[]
Actual behavior:
...args
hasany
typePlayground Link:
Related Issues:
The text was updated successfully, but these errors were encountered: