parent
399b2e3134
commit
40b58a0a18
3 changed files with 17 additions and 1 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
10
tests/deprecated/tmessages.nim
Normal file
10
tests/deprecated/tmessages.nim
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
discard """
|
||||
nimout:'''tmessages.nim(10, 1) Warning: Deprecated since v1.2.0, use 'HelloZ'; hello is deprecated [Deprecated]
|
||||
'''
|
||||
"""
|
||||
|
||||
proc hello[T](a: T) {.deprecated: "Deprecated since v1.2.0, use 'HelloZ'".} =
|
||||
discard
|
||||
|
||||
|
||||
hello[int](12)
|
||||
Loading…
Add table
Add a link
Reference in a new issue