summary refs log tree commit diff stats
path: root/tests/errmsgs/tproper_stacktrace2.nim
blob: 44b208c87db66ff663c8ed89aed2b308d09b783d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
discard """
  outputsub: '''tproper_stacktrace2.nim(20) main'''
  exitcode: 1
"""

proc returnsNil(): ref int = return nil

iterator fields*(a, b: int): int =
  if a == b:
    for f in a..b:
      yield f
  else:
    for f in a..b:
      yield f

proc main(): string =
  result = ""
  for i in fields(0, 1):
    let x = returnsNil()
    result &= "string literal " & $x[]

echo main()