Skip to content
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

One more case of inlining breaking async/await #5857

Closed
cknitt opened this issue Nov 28, 2022 · 0 comments
Closed

One more case of inlining breaking async/await #5857

cknitt opened this issue Nov 28, 2022 · 0 comments

Comments

@cknitt
Copy link
Member

cknitt commented Nov 28, 2022

This is similar to the already fixed case in #5754. But it still occurs in 10.1.

external ignorePromise: promise<'a> => unit = "%identity"

let wrapSomethingAsync = () =>
  (
    async () => {
      let test = await Js.Promise.resolve("Test")
      Js.log(test)
    }
  )()->ignorePromise

compiles to

function wrapSomethingAsync(param) {
  var test = await Promise.resolve("Test");
  console.log(test);
}

which is invalid because the function is not marked as async.

cristianoc added a commit that referenced this issue Nov 28, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Fixes #5857
cristianoc added a commit that referenced this issue Nov 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants