tproper_stacktrace3.nim 520 B

12345678910111213141516171819202122232425
  1. discard """
  2. matrix: "--stackTrace:on"
  3. outputsub: '''tproper_stacktrace3.nim(22) main'''
  4. exitcode: 1
  5. """
  6. # bug #5400
  7. type Container = object
  8. val: int
  9. proc actualResolver(x: ptr Container): ptr Container = x
  10. template resolve(): untyped = actualResolver(db)
  11. proc myfail(): int =
  12. doAssert false
  13. proc main() =
  14. var db: ptr Container = nil
  15. # actualResolver(db).val = myfail() # actualResolver is not included in stack trace.
  16. resolve().val = myfail() # resolve template is included in stack trace.
  17. main()