Implicit return working for async proc (#20933)

* Implicit return working for asyncdispatch proc

Closes #11558

* Test case

* Test that return value is actually used

* Update tests/async/t11558.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
This commit is contained in:
Jake Leahy
2022-12-10 04:10:33 +11:00
committed by GitHub
parent 0cd9bdcf9f
commit da3274d1b3
2 changed files with 24 additions and 2 deletions

13
tests/async/t11558.nim Normal file
View File

@@ -0,0 +1,13 @@
discard """
output: "Hello\n9"
"""
import std/asyncdispatch
proc foo(): Future[string] {.async.} =
"Hello"
proc bar(): Future[int] {.async.} =
result = 9
echo waitFor foo()
echo waitFor bar()