improvement for 'unused import' warnings

This commit is contained in:
Araq
2019-09-02 12:49:31 +02:00
parent 23c44f009a
commit fc7fe636e2
2 changed files with 2 additions and 0 deletions

View File

@@ -80,6 +80,7 @@ proc symChoice(c: PContext, n: PNode, s: PSym, r: TSymChoiceRule;
while a != nil:
if a.kind != skModule and (not isField or sfGenSym notin s.flags):
incl(a.flags, sfUsed)
markOwnerModuleAsUsed(c, a)
addSon(result, newSymNode(a, info))
onUse(info, a)
a = nextOverloadIter(o, c, n)

View File

@@ -108,6 +108,7 @@ const
isNilConversion = isConvertible # maybe 'isIntConv' fits better?
proc markUsed*(c: PContext; info: TLineInfo, s: PSym)
proc markOwnerModuleAsUsed*(c: PContext; s: PSym)
template hasFauxMatch*(c: TCandidate): bool = c.fauxMatch != tyNone