summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorquantimnot <54247259+quantimnot@users.noreply.github.com>2023-04-21 06:06:20 -0400
committerGitHub <noreply@github.com>2023-04-21 18:06:20 +0800
commit175a83c2de436b0e84f232fd44d264fb2c79fb14 (patch)
tree593e6a2147864ea84e0d7a18bdd4b4fa6e71b890
parentd76458a6cd126a338f7499b1012559883ae7fe5d (diff)
downloadNim-175a83c2de436b0e84f232fd44d264fb2c79fb14.tar.gz
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>
-rw-r--r--lib/std/assertions.nim7
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/std/assertions.nim b/lib/std/assertions.nim
index a249d7751..3dca644ad 100644
--- a/lib/std/assertions.nim
+++ b/lib/std/assertions.nim
@@ -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: