the 'deprecated' pragma for modules now supports an error message
This commit is contained in:
parent
c34cb101b8
commit
8518683dc7
3 changed files with 12 additions and 3 deletions
|
|
@ -148,7 +148,10 @@ proc myImportModule(c: PContext, n: PNode): PSym =
|
|||
result.info.fileIndex == n.info.fileIndex:
|
||||
localError(n.info, errGenerated, "A module cannot import itself")
|
||||
if sfDeprecated in result.flags:
|
||||
message(n.info, warnDeprecated, result.name.s)
|
||||
if result.constraint != nil:
|
||||
message(n.info, warnDeprecated, result.constraint.strVal & "; " & result.name.s)
|
||||
else:
|
||||
message(n.info, warnDeprecated, result.name.s)
|
||||
suggestSym(n.info, result, c.graph.usageSym, false)
|
||||
|
||||
proc impMod(c: PContext; it: PNode) =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue