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
Hi, I believe the problem seems to be that type argument inference isn't 'smart' enough here to infer R from the function type () => R, which involves a reference to a generic parameter.
When compiling the following code: (the function
call
takes a 0-argument function and returns its result)I get the following incorrect error: (on the last line)
try.ts(7,5): error TS2322: Type '{}' is not assignable to type 'number'.
The following workaround, adding an unused dummy argument of type T to the function, avoids this error:
The text was updated successfully, but these errors were encountered: