* --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
This commit is contained in:
Andreas Rumpf 2019-02-18 15:23:05 +01:00 • committed by GitHub
commit 2deb1e354f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 118 additions and 50 deletions

View file

@ -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")