mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 17:34:43 +00:00
17 lines
217 B
Nim
17 lines
217 B
Nim
discard """
|
|
output: '''0
|
|
1
|
|
2'''
|
|
"""
|
|
# bug #1725
|
|
iterator factory(): int {.closure.} =
|
|
iterator bar(): int {.closure.} =
|
|
yield 0
|
|
yield 1
|
|
yield 2
|
|
|
|
for x in bar(): yield x
|
|
|
|
for x in factory():
|
|
echo x
|