fixes #9358
This commit is contained in:
parent
5b97762787
commit
0c3e6735ac
1 changed files with 3 additions and 3 deletions
|
|
@ -949,10 +949,10 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: var int,
|
||||||
recordPragma(c, it, "warning", s)
|
recordPragma(c, it, "warning", s)
|
||||||
message(c.config, it.info, warnUser, s)
|
message(c.config, it.info, warnUser, s)
|
||||||
of wError:
|
of wError:
|
||||||
if sym != nil and (sym.isRoutine or sym.kind == skType):
|
if sym != nil and (sym.isRoutine or sym.kind == skType) and wUsed in validPragmas:
|
||||||
# This is subtle but correct: the error *statement* is only
|
# This is subtle but correct: the error *statement* is only
|
||||||
# allowed for top level statements. Seems to be easier than
|
# allowed when 'wUsed' is not in validPragmas. Here this is the easiest way to
|
||||||
# distinguishing properly between
|
# distinguish properly between
|
||||||
# ``proc p() {.error}`` and ``proc p() = {.error: "msg".}``
|
# ``proc p() {.error}`` and ``proc p() = {.error: "msg".}``
|
||||||
if it.kind in nkPragmaCallKinds: discard getStrLitNode(c, it)
|
if it.kind in nkPragmaCallKinds: discard getStrLitNode(c, it)
|
||||||
incl(sym.flags, sfError)
|
incl(sym.flags, sfError)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue