summary refs log blame commit diff stats
path: root/tests/iter/tnested_closure_iter.nim
blob: ec2253cf18fa501d6ea9ea04fb0cb52e048e1ef4 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16















                                     
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