summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorJake Leahy <jake@leahy.dev>2022-12-10 04:10:33 +1100
committerGitHub <noreply@github.com>2022-12-09 18:10:33 +0100
commitda3274d1b3bb5cc737a5aca900dd231e4223fa60 (patch)
tree94d5778b374067c22f848577d07d3935a13cae05 /tests
parent0cd9bdcf9f6802421e0d8e4c28fc732012af605e (diff)
downloadNim-da3274d1b3bb5cc737a5aca900dd231e4223fa60.tar.gz
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>
Diffstat (limited to 'tests')
-rw-r--r--tests/async/t11558.nim13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/async/t11558.nim b/tests/async/t11558.nim
new file mode 100644
index 000000000..99961e7b6
--- /dev/null
+++ b/tests/async/t11558.nim
@@ -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()