fixes #21195; std/assertions continue to use sysFatal when nimPreviewSlimSystem is not defined (#21196)
* fixes #21195; `std/assertions` continue to use `sysFatal` * try includes * make `std/assertions` self-contained * fixes tests * fixes tests
This commit is contained in:
parent
705da9d452
commit
ebd1c678be
7 changed files with 63 additions and 30 deletions
|
|
@ -7,6 +7,10 @@
|
|||
# distribution, for details about the copyright.
|
||||
#
|
||||
|
||||
when not defined(nimPreviewSlimSystem) and not declared(sysFatal):
|
||||
include "system/rawquits"
|
||||
include "system/fatal"
|
||||
|
||||
## This module implements assertion handling.
|
||||
|
||||
import std/private/miscdollars
|
||||
|
|
@ -26,7 +30,10 @@ proc `$`(info: InstantiationInfo): string =
|
|||
|
||||
proc raiseAssert*(msg: string) {.noinline, noreturn, nosinks.} =
|
||||
## Raises an `AssertionDefect` with `msg`.
|
||||
raise newException(AssertionDefect, msg)
|
||||
when defined(nimPreviewSlimSystem):
|
||||
raise newException(AssertionDefect, msg)
|
||||
else:
|
||||
sysFatal(AssertionDefect, msg)
|
||||
|
||||
proc failedAssertImpl*(msg: string) {.raises: [], tags: [].} =
|
||||
## Raises an `AssertionDefect` with `msg`, but this is hidden
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue