mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 05:50:30 +00:00
committed by
Andreas Rumpf
parent
d4af0554c4
commit
84351da9d8
@@ -27,12 +27,12 @@ proc failedAssertImpl*(msg: string) {.raises: [], tags: [].} =
|
||||
Hide(raiseAssert)(msg)
|
||||
|
||||
template assertImpl(cond: bool, msg: string, expr: string, enabled: static[bool]) =
|
||||
const
|
||||
loc = instantiationInfo(fullPaths = compileOption("excessiveStackTrace"))
|
||||
ploc = $loc
|
||||
bind instantiationInfo
|
||||
mixin failedAssertImpl
|
||||
when enabled:
|
||||
const
|
||||
loc = instantiationInfo(fullPaths = compileOption("excessiveStackTrace"))
|
||||
ploc = $loc
|
||||
bind instantiationInfo
|
||||
mixin failedAssertImpl
|
||||
{.line: loc.}:
|
||||
if not cond:
|
||||
failedAssertImpl(ploc & " `" & expr & "` " & msg)
|
||||
|
||||
Reference in New Issue
Block a user