Files
Nim/tests/closure/t8550.nim
LemonBoy ba7c874a7d Mysterious fix for #8550 (#8561)
Replacing the `for` body with a nkEmpty node is not the right thing to
do.
2018-08-12 20:41:48 +02:00

13 lines
255 B
Nim

discard """
output: "@[\"42\"]"
"""
proc chk_fail(): seq[string] =
iterator x(): int {.closure.} = yield 42
proc f(cl: iterator(): int {.closure.}): seq[string] =
result = @[]
for i in cl(): result.add($i)
result = f(x)
echo(chk_fail())