{.deprecated: msg.} now works for vars and lets (#10234)

This commit is contained in:
Neelesh Chandola 2019-01-09 00:14:47 +05:30 • committed by Andreas Rumpf
commit fb26b95f81
4 changed files with 16 additions and 10 deletions

View file

@ -881,7 +881,7 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: var int,
of wExplain:
sym.flags.incl sfExplain
of wDeprecated:
if sym != nil and sym.kind in routineKinds + {skType}:
if sym != nil and sym.kind in routineKinds + {skType, skVar, skLet}:
if it.kind in nkPragmaCallKinds: discard getStrLitNode(c, it)
incl(sym.flags, sfDeprecated)
elif sym != nil and sym.kind != skModule: