don't require an implementation for procs marked with .error; activate the move optimizer for destructors

This commit is contained in:
Araq 2018-09-29 16:54:50 +02:00
commit 40e01d8549
5 changed files with 65 additions and 19 deletions

View file

@ -961,6 +961,7 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: var int,
# ``proc p() {.error}`` and ``proc p() = {.error: "msg".}``
if it.kind in nkPragmaCallKinds: discard getStrLitNode(c, it)
incl(sym.flags, sfError)
excl(sym.flags, sfForward)
else:
let s = expectStrLit(c, it)
recordPragma(c, it, "error", s)