Skip to content

asyncjs breaks with bare return when return type is not void #25716

@metagn

Description

@metagn

Nim Version

devel

Description

import std/asyncjs

proc foo(): Future[int] {.async.} =
  result = 123
  return

Current Output

a.nim(3, 27) template/generic instantiation of `async` from here
lib/js/asyncjs.nim(87, 26) Error: type mismatch: got 'None' for 'jsResolve' but expected 'Future[system.int]'

Expected Output

works

Known Workarounds

use return result

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    AsyncEverything related to Nim's asyncJavascript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions