Closed
Description
I think the following should result in an error, but it passes the type checker:
function foo<T>(getT: () => T, setT: (t: T) => void) { }
function getString() {
return 'a';
}
function setNum(n: number) { }
foo(getString, setNum);
Hovering over the call to foo in VS or the Playground shows that T has been inferred to be of type {}, but since {} isn't of type number, doesn't that make setNum an invalid argument to be passing in?