t21737.nim 397 B

1234567891011121314151617181920212223
  1. discard """
  2. action: compile
  3. """
  4. template mytoSeq*(iter: untyped): untyped =
  5. var result: seq[typeof(iter)]# = @[]
  6. for x in iter:
  7. result.add(x)
  8. result
  9. iterator test(dir:int): int =
  10. yield 1234
  11. iterator walkGlobKinds (): int =
  12. let dir2 = 123
  13. let it = mytoSeq(test(dir2))
  14. proc main()=
  15. let it = iterator(): int=
  16. for path in walkGlobKinds():
  17. yield path
  18. main()