Skip to content

Async function returns Promise metatable instead of value #1185

@prnxdev

Description

@prnxdev

Here's code:

async function receive(): Promise<boolean> {
  return new Promise(resolve => {
    resolve(true);
  })
}

receive().then(v => {
    print(v);
})

and a is Promise metatable and it should be true

also check this out on playground: https://typescripttolua.github.io/play/#code/IYZwngdgxgBAZgV2gFwJYHsIygCwKZQDWAFAJQBcMACgE7oC2qIeAPAEbroA2ewEAfDADeAKBjiYNPMgQ0sEPAHdqdRs2LEpIbgDc8pGAF5BoiWcl5tXPcWQ0E+gNxiJAX1LPXIkaEixEKBhY9MCoEGTCLuJQmCDIMMBGCYqh8bgEJB5RMAAONGHIxMBZXiIhYWSOQA

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions