mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 01:44:37 +00:00
13 lines
255 B
Nim
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())
|