fix #8928
This commit is contained in:
parent
8670f4911b
commit
b5f463c3f6
1 changed files with 5 additions and 2 deletions
|
|
@ -3783,8 +3783,11 @@ template assertImpl(cond: bool, msg = "", enabled: static[bool]) =
|
||||||
bind instantiationInfo
|
bind instantiationInfo
|
||||||
mixin failedAssertImpl
|
mixin failedAssertImpl
|
||||||
when enabled:
|
when enabled:
|
||||||
if not cond:
|
# for stacktrace; fixes #8928 ; Note: `fullPaths = true` is correct
|
||||||
failedAssertImpl(loc & " `" & astToStr(cond) & "` " & msg)
|
# here, regardless of --excessiveStackTrace
|
||||||
|
{.line: instantiationInfo(fullPaths = true).}:
|
||||||
|
if not cond:
|
||||||
|
failedAssertImpl(loc & " `" & astToStr(cond) & "` " & msg)
|
||||||
|
|
||||||
template assert*(cond: bool, msg = "") =
|
template assert*(cond: bool, msg = "") =
|
||||||
## Raises ``AssertionError`` with `msg` if `cond` is false. Note
|
## Raises ``AssertionError`` with `msg` if `cond` is false. Note
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue