fixes #5314
This commit is contained in:
parent
b15e8124fe
commit
072d79511f
2 changed files with 18 additions and 1 deletions
17
tests/async/tasync_in_seq_constr.nim
Normal file
17
tests/async/tasync_in_seq_constr.nim
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
discard """
|
||||
output: '''@[1, 2, 3, 4]'''
|
||||
"""
|
||||
|
||||
# bug #5314
|
||||
|
||||
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()
|
||||
Loading…
Add table
Add a link
Reference in a new issue