diff options
author | Araq <rumpf_a@web.de> | 2018-04-06 11:56:53 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2018-04-06 11:59:49 +0200 |
commit | 8518683dc7f76465b41bd0ccf19f9fab06cd5e32 (patch) | |
tree | 46aa29d67df12536eee7a08b67822a425b1ea1b2 /compiler/importer.nim | |
parent | c34cb101b8621d52680892ae4041dff6541f1c0a (diff) | |
download | Nim-8518683dc7f76465b41bd0ccf19f9fab06cd5e32.tar.gz |
the 'deprecated' pragma for modules now supports an error message
Diffstat (limited to 'compiler/importer.nim')
-rw-r--r-- | compiler/importer.nim | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/importer.nim b/compiler/importer.nim index 3d7f62464..f4903e6c4 100644 --- a/compiler/importer.nim +++ b/compiler/importer.nim @@ -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) = |