summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--lib/system/assertions.nim10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/system/assertions.nim b/lib/system/assertions.nim
index 0deb957c9..2131394e0 100644
--- a/lib/system/assertions.nim
+++ b/lib/system/assertions.nim
@@ -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)
href='#n96'>96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125