summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2017-02-16 22:50:21 +0100
committerAraq <rumpf_a@web.de>2017-02-16 22:50:21 +0100
commit804b0ff99c8a4c71c29d608b774507947d4c69d2 (patch)
tree100e72a0e510e32fd3f7779607da19468dcc764f /tests
parent0440aea69158dfde7e315d547f8f2ed474a705c0 (diff)
downloadNim-804b0ff99c8a4c71c29d608b774507947d4c69d2.tar.gz
fixes #5400
Diffstat (limited to 'tests')
-rw-r--r--tests/errmsgs/tproper_stacktrace3.nim23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/errmsgs/tproper_stacktrace3.nim b/tests/errmsgs/tproper_stacktrace3.nim
new file mode 100644
index 000000000..c292fa092
--- /dev/null
+++ b/tests/errmsgs/tproper_stacktrace3.nim
@@ -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()