treciter.nim 291 B

12345678910111213
  1. discard """
  2. errormsg: "recursive dependency: \'myrec\'"
  3. file: "treciter.nim"
  4. line: 9
  5. """
  6. # Test that an error message occurs for a recursive iterator
  7. iterator myrec(n: int): int =
  8. for x in myrec(n-1): #ERROR_MSG recursive dependency: 'myrec'
  9. yield x
  10. for x in myrec(10): echo x