summary refs log tree commit diff stats
path: root/tests/async/tasync_in_seq_constr.nim
blob: 7d216e352f9ba722d8a5317f43bce5f778bd5c02 (plain) (blame)
1
2
3
4
5
6
7
8
9
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #0
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()
pan> name="input1" size="10" /> <input type="button" value="Calculate square" onclick="OnButtonClick()" /> </form> </body> </html>