-
Notifications
You must be signed in to change notification settings - Fork 463
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 function with @this attribute #6100
Comments
Thank you for reporting this. |
To verify the hypothesis, let's put the second example in ./bsc -dsource tst.res
let method =
Js_OO.unsafe_to_method
({ I2 = (fun this -> fun arg -> this + arg) } : _ Js_OO.Callback.arity2) there's no attribute. Instead a single async function would look like this internally: let foo = ((fun arg -> Js.Promise.unsafe_async (arg + 1))[@res.async ]) So this seems to confirm the hypothesis. |
Looking at this cheat sheet, the |
Looks like this https://github.com/rescript-lang/rescript-compiler/blob/master/jscomp/frontend/ast_core_type_class_type.ml#L84 is the pace where it is handled. |
Here's the fix: The issue and fix are as expected. |
In
rescript v10.1.3
, the example above will fail as the following :By the way, the following ReScript code will generate JavaScript code without
async
:The text was updated successfully, but these errors were encountered: