mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-24 00:05:25 +00:00
fixes #5400
This commit is contained in:
23
tests/errmsgs/tproper_stacktrace3.nim
Normal file
23
tests/errmsgs/tproper_stacktrace3.nim
Normal file
@@ -0,0 +1,23 @@
|
||||
discard """
|
||||
outputsub: '''tproper_stacktrace3.nim(21) main'''
|
||||
exitcode: 1
|
||||
"""
|
||||
|
||||
# bug #5400
|
||||
|
||||
type Container = object
|
||||
val: int
|
||||
|
||||
proc actualResolver(x: ptr Container): ptr Container = x
|
||||
|
||||
template resolve(): untyped = actualResolver(db)
|
||||
|
||||
proc myfail(): int =
|
||||
doAssert false
|
||||
|
||||
proc main() =
|
||||
var db: ptr Container = nil
|
||||
# actualResolver(db).val = myfail() # actualResolver is not included in stack trace.
|
||||
resolve().val = myfail() # resolve template is included in stack trace.
|
||||
|
||||
main()
|
||||
Reference in New Issue
Block a user