[feature] detect unused imports

This commit is contained in:
Araq 2019-07-17 22:36:23 +02:00
commit 4137a4dbf3
12 changed files with 62 additions and 33 deletions

View file

@ -474,7 +474,7 @@ proc semResolvedCall(c: PContext, x: TCandidate,
assert x.state == csMatch
var finalCallee = x.calleeSym
let info = getCallLineInfo(n)
markUsed(c.config, info, finalCallee, c.graph.usageSym)
markUsed(c, info, finalCallee, c.graph.usageSym)
onUse(info, finalCallee)
assert finalCallee.ast != nil
if x.hasFauxMatch:
@ -584,7 +584,7 @@ proc explicitGenericSym(c: PContext, n: PNode, s: PSym): PNode =
var newInst = generateInstance(c, s, m.bindings, n.info)
newInst.typ.flags.excl tfUnresolved
let info = getCallLineInfo(n)
markUsed(c.config, info, s, c.graph.usageSym)
markUsed(c, info, s, c.graph.usageSym)
onUse(info, s)
result = newSymNode(newInst, info)