-
-
Notifications
You must be signed in to change notification settings - Fork 545
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Asyncify lost the general return type #178
Comments
// @papb |
Playground here: |
Oops, sorry for the delay, I missed this notification. Hmm... This is a TypeScript limitation, unfortunately. The simple act of writing I tried for some time to find another workaround to keep at least the most common generic usages but I couldn't. Here are some related TS issues: microsoft/TypeScript#39594, microsoft/TypeScript#10247, microsoft/TypeScript#37835. This problem also happens with Should we add a note to the docs that it does not work with functions with generic types? |
Thank you, I also confirmed today from TS member, this is a design limintation microsoft/TypeScript#42706 Seems there is no official workaround currently. |
I have a 'get' method like this:
And I Asyncify it through this:
Then the result lost the type:
I can see it don't allow the general type now:
it used to know the return type based on the input...
Is it possible to solve this?
https://github.com/sindresorhus/type-fest/blob/main/source/asyncify.d.ts
The text was updated successfully, but these errors were encountered: