tproper_stacktrace2.nim 385 B

1234567891011121314151617181920212223
  1. discard """
  2. outputsub: '''tproper_stacktrace2.nim(20) main'''
  3. exitcode: 1
  4. """
  5. proc returnsNil(): ref int = return nil
  6. iterator fields*(a, b: int): int =
  7. if a == b:
  8. for f in a..b:
  9. yield f
  10. else:
  11. for f in a..b:
  12. yield f
  13. proc main(): string =
  14. result = ""
  15. for i in fields(0, 1):
  16. let x = returnsNil()
  17. result &= "string literal " & $x[]
  18. echo main()