Replacing the `for` body with a nkEmpty node is not the right thing to do.
This commit is contained in:
parent
089529c16a
commit
ba7c874a7d
2 changed files with 14 additions and 5 deletions
12
tests/closure/t8550.nim
Normal file
12
tests/closure/t8550.nim
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
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())
|
||||
Loading…
Add table
Add a link
Reference in a new issue