Allow stacktrace and linetrace pragmas on procs

This commit is contained in:
Yuriy Glukhov 2018-06-12 12:17:03 +03:00
commit 7e7b85afc7
3 changed files with 23 additions and 2 deletions

View file

@ -119,5 +119,23 @@ when isMainModule:
verifyStackTrace expectedStackTrace:
foo()
block:
proc bar() {.stackTrace: off.} =
proc baz() = # Stack trace should be enabled
raiseTestException()
baz()
proc foo() =
bar()
const expectedStackTrace = """
tproper_stacktrace.nim(139) tproper_stacktrace
tproper_stacktrace.nim(129) foo
tproper_stacktrace.nim(125) baz
tproper_stacktrace.nim(7) raiseTestException
"""
verifyStackTrace expectedStackTrace:
foo()
echo "ok"