Skip to content

One more case of inlining breaking async/await #5857

@cknitt

Description

@cknitt

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions