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
The function toArrayWrapped2 is of type { wrappedFunc: (t: any) => { wrapped: any[] } }. The inference of the type parameter T from toArray was lost when the return type was wrapped.
🙂 Expected behavior
The function toArrayWrapped2 is of type { wrappedFunc: <T>(t: T) => { wrapped: T[] } }. This would preserve the type parameter T from toArray just like the unwrapped result type of toArrayWrapped.
The text was updated successfully, but these errors were encountered:
maclockard
changed the title
Higher order type inference from generic functions lost when result in wrapped
Higher order type inference from generic functions lost when result type is wrapped
Dec 10, 2022
Bug Report
🔎 Search Terms
Higher order type, Higher kinded type, Inference generic lost, Wrapped
🕗 Version & Regression Information
and fill in the line that best applies:
⏯ Playground Link
Playground link with relevant code
💻 Code
🙁 Actual behavior
The function
toArrayWrapped2
is of type{ wrappedFunc: (t: any) => { wrapped: any[] } }
. The inference of the type parameterT
fromtoArray
was lost when the return type was wrapped.🙂 Expected behavior
The function
toArrayWrapped2
is of type{ wrappedFunc: <T>(t: T) => { wrapped: T[] } }
. This would preserve the type parameterT
fromtoArray
just like the unwrapped result type oftoArrayWrapped
.The text was updated successfully, but these errors were encountered: