doAssert, assert now print full path of failing line on error (#8555)
This commit is contained in:
parent
81f920a4ee
commit
3a626179ee
6 changed files with 109 additions and 32 deletions
11
lib/system/helpers.nim
Normal file
11
lib/system/helpers.nim
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
## helpers used system.nim and other modules, avoids code duplication while
|
||||
## also minimizing symbols exposed in system.nim
|
||||
#
|
||||
# TODO: move other things here that should not be exposed in system.nim
|
||||
|
||||
proc lineInfoToString(file: string, line, column: int): string =
|
||||
file & "(" & $line & ", " & $column & ")"
|
||||
|
||||
proc `$`(info: type(instantiationInfo(0))): string =
|
||||
# The +1 is needed here
|
||||
lineInfoToString(info.fileName, info.line, info.column+1)
|
||||
Loading…
Add table
Add a link
Reference in a new issue