summary refs log tree commit diff stats
path: root/tests/async/tasync_in_seq_constr.nim
blob: cf9bb545169afc4771b0a05c99f62f12a5b3f1cf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
discard """
  output: "@[1, 2, 3, 4]"
"""

# bug #5314, bug #6626

import asyncdispatch

proc bar(): Future[int] {.async.} =
    await sleepAsync(500)
    result = 3

proc foo(): Future[seq[int]] {.async.} =
    await sleepAsync(500)
    result = @[1, 2, await bar(), 4] # <--- The bug is here

echo waitFor foo()