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
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?
The text was updated successfully, but these errors were encountered:
I think the following should result in an error, but it passes the type checker:
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?
The text was updated successfully, but these errors were encountered: