-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
async
functions don't have proper type signatures in Typescript
#2394
Comments
Thanks for the report! This is due to how |
Also running into this problem - would love to see a fix! I'd be happy to work on it, but would need some direction since I'm unfamiliar with the codebase and somewhat new to writing macros. |
@alexcrichton why |
@iuslkae Darn, I was just trying that now and landed here. :( |
@jeremyBanks maybe there is a way to override the output at own risk, cuz the tool they are using is working worng. Could be good if they document how to achieve this to make a pull req. Since the I'm just logging the responses to get their tipes and type each one on projects i work ;'D |
This not only affects Typescript types. JSDoc autogenerated documentation also outputs |
@arnauorriols My PR linked above (which looks on track to be merged soon) also adds the JSDoc comments! |
Describe the Bug
As soon as a function is
async
, the return type in the Typescript definition is alwaysany
.Steps to Reproduce
async
function with#[wasm_bindgen]
:Run
wasm-pack build
Observe the generated typescript types:
Expected Behavior
The type definition for
async_greet
should be:Actual Behavior
Function has return type
any
.The text was updated successfully, but these errors were encountered: