summary refs log tree commit diff stats
path: root/compiler/pragmas.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2019-02-18 15:23:05 +0100
committerGitHub <noreply@github.com>2019-02-18 15:23:05 +0100
commit2deb1e354fb7eba063c125579af04911f14382ed (patch)
treed27830529923022bd975fac7b23a606b7d1fcb28 /compiler/pragmas.nim
parent1d66222901f0812bf5ffd5fc4e8175acb1948c9e (diff)
downloadNim-2deb1e354fb7eba063c125579af04911f14382ed.tar.gz
fixes #10702 (#10705)
* --define:nimQuirky exception handling for Nim; in preparation of a blog post
* make it work with latest system.nim
* make code more readable
* fixes #10702
Diffstat (limited to 'compiler/pragmas.nim')
-rw-r--r--compiler/pragmas.nim4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/pragmas.nim b/compiler/pragmas.nim
index 3eedf15a9..9b3c66104 100644
--- a/compiler/pragmas.nim
+++ b/compiler/pragmas.nim
@@ -875,7 +875,9 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: var int,
         incl(sym.flags, sfSideEffect)
       of wNoreturn:
         noVal(c, it)
-        incl(sym.flags, sfNoReturn)
+        # Disable the 'noreturn' annotation when in the "Quirky Exceptions" mode!
+        if not isDefined(c.config, "nimQuirky"):
+          incl(sym.flags, sfNoReturn)
         if sym.typ[0] != nil:
           localError(c.config, sym.ast[paramsPos][0].info,
             ".noreturn with return type not allowed")