mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 01:14:41 +00:00
refact: Remove assertion effect hiding workaround (#21472)
refact: Remove asseertion effect hiding workaround There was a code comment to remove after bootstrapping with `nim >= 1.4.0`. Co-authored-by: quantimnot <quantimnot@users.noreply.github.com> Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
This commit is contained in:
@@ -38,12 +38,7 @@ proc raiseAssert*(msg: string) {.noinline, noreturn, nosinks.} =
|
||||
proc failedAssertImpl*(msg: string) {.raises: [], tags: [].} =
|
||||
## Raises an `AssertionDefect` with `msg`, but this is hidden
|
||||
## from the effect system. Called when an assertion failed.
|
||||
# trick the compiler to not list `AssertionDefect` when called
|
||||
# by `assert`.
|
||||
# xxx simplify this pending bootstrap >= 1.4.0, after which cast not needed
|
||||
# anymore since `Defect` can't be raised.
|
||||
type Hide = proc (msg: string) {.noinline, raises: [], noSideEffect, tags: [].}
|
||||
cast[Hide](raiseAssert)(msg)
|
||||
raiseAssert(msg)
|
||||
|
||||
template assertImpl(cond: bool, msg: string, expr: string, enabled: static[bool]) =
|
||||
when enabled:
|
||||
|
||||
Reference in New Issue
Block a user