the 'deprecated' pragma for modules now supports an error message

This commit is contained in:
Araq 2018-04-06 11:56:53 +02:00
commit 8518683dc7
3 changed files with 12 additions and 3 deletions

View file

@ -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) =