diff options
author | flywind <43030857+xflywind@users.noreply.github.com> | 2020-07-09 15:57:35 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-09 09:57:35 +0200 |
commit | 40b58a0a1864e0cc06ecd0ceb8aadf9e933eeb30 (patch) | |
tree | 2b02564a67c7f2b499daa81f6cc04a881a9751d4 /compiler | |
parent | 399b2e3134751432f66a2414fbaf9c2a168fa953 (diff) | |
download | Nim-40b58a0a1864e0cc06ecd0ceb8aadf9e933eeb30.tar.gz |
fix #11009 (#14935)
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/semdata.nim | 1 | ||||
-rw-r--r-- | compiler/suggest.nim | 7 |
2 files changed, 7 insertions, 1 deletions
diff --git a/compiler/semdata.nim b/compiler/semdata.nim index 5a2c08de2..8680fcac3 100644 --- a/compiler/semdata.nim +++ b/compiler/semdata.nim @@ -143,6 +143,7 @@ type # would otherwise fail. unusedImports*: seq[(PSym, TLineInfo)] exportIndirections*: HashSet[(int, int)] + lastTLineInfo*: TLineInfo template config*(c: PContext): ConfigRef = c.graph.config diff --git a/compiler/suggest.nim b/compiler/suggest.nim index a9f248fb9..6e9844759 100644 --- a/compiler/suggest.nim +++ b/compiler/suggest.nim @@ -557,7 +557,12 @@ proc markUsed(c: PContext; info: TLineInfo; s: PSym) = if sfDeprecated in s.owner.flags: warnAboutDeprecated(conf, info, s) if {sfDeprecated, sfError} * s.flags != {}: - if sfDeprecated in s.flags: warnAboutDeprecated(conf, info, s) + if sfDeprecated in s.flags: + if not (c.lastTLineInfo.line == info.line and + c.lastTLineInfo.col == info.col): + warnAboutDeprecated(conf, info, s) + c.lastTLineInfo = info + if sfError in s.flags: userError(conf, info, s) when defined(nimsuggest): suggestSym(conf, info, s, c.graph.usageSym, false) |