From da3274d1b3bb5cc737a5aca900dd231e4223fa60 Mon Sep 17 00:00:00 2001 From: Jake Leahy Date: Sat, 10 Dec 2022 04:10:33 +1100 Subject: 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 --- tests/async/t11558.nim | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 tests/async/t11558.nim (limited to 'tests') 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() -- cgit 1.4.1-2-gfad0 /option> Soul of a tiny new machine. More thorough tests → More comprehensible and rewrite-friendly software → More resilient society.Kartik K. Agaram <vc@akkartik.com>
about summary refs log tree commit diff stats
blob: e620a87ccd87442f8b74060191d550b0b4b05d91 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60