mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-01 19:02:18 +00:00
14 lines
273 B
Nim
14 lines
273 B
Nim
discard """
|
|
targets: "c js"
|
|
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())
|