diff --git a/compiler/semcall.nim b/compiler/semcall.nim index a1892886a3..bb26a9078e 100644 --- a/compiler/semcall.nim +++ b/compiler/semcall.nim @@ -789,8 +789,8 @@ 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, info, s) - onUse(info, s) + markUsed(c, info, newInst) + onUse(info, newInst) result = newSymNode(newInst, info) proc setGenericParams(c: PContext, n, expectedParams: PNode) = diff --git a/compiler/semtempl.nim b/compiler/semtempl.nim index 10440614d9..e058753dba 100644 --- a/compiler/semtempl.nim +++ b/compiler/semtempl.nim @@ -67,8 +67,6 @@ proc symChoice(c: PContext, n: PNode, s: PSym, r: TSymChoiceRule; # for instance 'nextTry' is both in tables.nim and astalgo.nim ... if not isField or sfGenSym notin s.flags: result = newSymNode(s, info) - markUsed(c, info, s) - onUse(info, s) else: result = n elif i == 0: