Closed
Description
TypeScript Version: 2.4.0
Code
function foo<T>(provider: () => T): T { return undefined; }
function giveMeTrue(): boolean { return true; }
const okay: boolean = foo(giveMeTrue); // okay
const notOkay: 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
.