* warnDuplicateModuleImport => hintDuplicateModuleImport * improve DuplicateModuleImport msg, add test
This commit is contained in:
parent
1b9b806007
commit
0b7361e938
14 changed files with 186 additions and 25 deletions
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
# included from sigmatch.nim
|
||||
|
||||
import algorithm, sets, prefixmatches, lineinfos, parseutils, linter
|
||||
import algorithm, sets, prefixmatches, lineinfos, parseutils, linter, tables
|
||||
from wordrecg import wDeprecated, wError, wAddr, wYield
|
||||
|
||||
when defined(nimsuggest):
|
||||
|
|
@ -572,7 +572,8 @@ proc markOwnerModuleAsUsed(c: PContext; s: PSym) =
|
|||
var i = 0
|
||||
while i <= high(c.unusedImports):
|
||||
let candidate = c.unusedImports[i][0]
|
||||
if candidate == module or c.exportIndirections.contains((candidate.id, s.id)):
|
||||
if candidate == module or c.importModuleMap.getOrDefault(candidate.id, int.low) == module.id or
|
||||
c.exportIndirections.contains((candidate.id, s.id)):
|
||||
# mark it as used:
|
||||
c.unusedImports.del(i)
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue