diff options
author | Araq <rumpf_a@web.de> | 2018-08-23 11:30:55 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2018-08-23 11:30:55 +0200 |
commit | 30597e643fe8818ef1bb6cc93a5c573f92a28ea9 (patch) | |
tree | ea6de7aabdbfc5db583e2dfbaf9f792c8240a63e /compiler/suggest.nim | |
parent | cb9e9297fba72c812913376311ca4b7ebd7e007f (diff) | |
parent | 55a86497491586dc1b5ad2f6303d53992b999ab5 (diff) | |
download | Nim-30597e643fe8818ef1bb6cc93a5c573f92a28ea9.tar.gz |
fixes merge conflict
Diffstat (limited to 'compiler/suggest.nim')
-rw-r--r-- | compiler/suggest.nim | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/compiler/suggest.nim b/compiler/suggest.nim index 3d3cd2484..770bf25e6 100644 --- a/compiler/suggest.nim +++ b/compiler/suggest.nim @@ -454,14 +454,23 @@ proc suggestSym*(conf: ConfigRef; info: TLineInfo; s: PSym; usageSym: var PSym; suggestResult(conf, symToSuggest(conf, s, isLocal=false, ideOutline, info, 100, PrefixMatch.None, false, 0)) proc warnAboutDeprecated(conf: ConfigRef; info: TLineInfo; s: PSym) = + var pragmaNode: PNode + if s.kind in routineKinds: - let n = s.ast[pragmasPos] - if n.kind != nkEmpty: - for it in n: - if whichPragma(it) == wDeprecated and it.safeLen == 2 and - it[1].kind in {nkStrLit..nkTripleStrLit}: - message(conf, info, warnDeprecated, it[1].strVal & "; " & s.name.s) - return + pragmaNode = s.ast[pragmasPos] + elif s.kind in {skType}: + # s.ast = nkTypedef / nkPragmaExpr / [nkSym, nkPragma] + pragmaNode = s.ast[0][1] + + doAssert pragmaNode == nil or pragmaNode.kind == nkPragma + + if pragmaNode != nil: + for it in pragmaNode: + if whichPragma(it) == wDeprecated and it.safeLen == 2 and + it[1].kind in {nkStrLit..nkTripleStrLit}: + message(conf, info, warnDeprecated, it[1].strVal & "; " & s.name.s) + return + message(conf, info, warnDeprecated, s.name.s) proc markUsed(conf: ConfigRef; info: TLineInfo; s: PSym; usageSym: var PSym) = |