tnested_closure_iter.nim 217 B

1234567891011121314151617
  1. discard """
  2. output: '''0
  3. 1
  4. 2'''
  5. """
  6. # bug #1725
  7. iterator factory(): int {.closure.} =
  8. iterator bar(): int {.closure.} =
  9. yield 0
  10. yield 1
  11. yield 2
  12. for x in bar(): yield x
  13. for x in factory():
  14. echo x