diff --git a/compiler/sem.nim b/compiler/sem.nim index 4b0f39c875..572993d310 100644 --- a/compiler/sem.nim +++ b/compiler/sem.nim @@ -88,6 +88,11 @@ proc fitNodePostMatch(c: PContext, formal: PType, arg: PNode): PNode = changeType(c, x, formal, check=true) result = arg result = skipHiddenSubConv(result, c.graph, c.idgen) + # mark inserted converter as used: + var a = result + if a.kind == nkHiddenDeref: a = a[0] + if a.kind == nkHiddenCallConv and a[0].kind == nkSym: + markUsed(c, a.info, a[0].sym) proc fitNode(c: PContext, formal: PType, arg: PNode; info: TLineInfo): PNode = diff --git a/compiler/semcall.nim b/compiler/semcall.nim index 7b34cab086..d96cceaca0 100644 --- a/compiler/semcall.nim +++ b/compiler/semcall.nim @@ -556,6 +556,15 @@ proc instGenericConvertersSons*(c: PContext, n: PNode, x: TCandidate) = for i in 1..