summary refs log tree commit diff stats
path: root/tests/iter/treciter.nim
blob: 11fb58224a92dd6cdf83f622aa54620825175206 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
discard """
  errormsg: "recursion is not supported in iterators: 'myrec'"
  file: "treciter.nim"
  line: 9
"""
# Test that an error message occurs for a recursive iterator

iterator myrec(n: int): int =
  for x in myrec(n-1): #ERROR_MSG recursive dependency: 'myrec'
    yield x

for x in myrec(10): echo x