tproper_stacktrace3.nim 492 B

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