-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Function should be assignable to (...args: any[]) => any #20007
Comments
The original intention of |
@mhegazy What's the benefit of such behavior, rather than treating I have a similar question about |
I'm using Having |
For folks working in JavaScript: /**
@typedef {(...args: any[]) => any} JavaScriptFunction
*/ Then just use |
Obviously all functions have type
Function
. And likewise all functions can be given the typeAFAIK, there is nothing one can do with something of type
Function
that cannot be done with something of typeAnyFunc
and vice versa. However they are not equivalently assignable:If I edit
lib.d.ts
to add a callable signature toFunction
:it seems to "fix" this issue; is there any reason not to make this change for real?
The text was updated successfully, but these errors were encountered: