doAssert, assert now print full path of failing line on error (#8555)

This commit is contained in:
Timothee Cour 2018-08-25 12:48:37 -07:00 • committed by Andreas Rumpf
commit 3a626179ee
6 changed files with 109 additions and 32 deletions

View file

@ -8,6 +8,7 @@
#
include "system/inclrtl"
include "system/helpers"
## This module contains the interface to the compiler's abstract syntax
## tree (`AST`:idx:). Macros operate on this tree.
@ -422,7 +423,8 @@ type
line*,column*: int
proc `$`*(arg: Lineinfo): string =
result = arg.filename & "(" & $arg.line & ", " & $arg.column & ")"
# BUG: without `result = `, gives compile error
result = lineInfoToString(arg.filename, arg.line, arg.column)
#proc lineinfo*(n: NimNode): LineInfo {.magic: "NLineInfo", noSideEffect.}
## returns the position the node appears in the original source file