You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
functionfoo<T>(provider: ()=>T): T{returnundefined;}functiongiveMeTrue(): boolean{returntrue;}constokay: boolean=foo(giveMeTrue);// okayconstnotOkay: boolean=foo(giveMeTrue.bind(this));// type '{}' is not assignable to type 'boolean'
Expected behavior:
Both should be okay - bind does not change the return type of the function.
Actual behavior:
bind changes the function return type to any.
The text was updated successfully, but these errors were encountered:
TypeScript Version: 2.4.0
Code
Expected behavior:
Both should be okay -
bind
does not change the return type of the function.Actual behavior:
bind
changes the function return type toany
.The text was updated successfully, but these errors were encountered: