diff --git a/compiler/sem.nim b/compiler/sem.nim index 2cf93d365f..286dcc30fa 100644 --- a/compiler/sem.nim +++ b/compiler/sem.nim @@ -89,6 +89,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 13f2273a9b..1f2b6bf2a0 100644 --- a/compiler/semcall.nim +++ b/compiler/semcall.nim @@ -645,6 +645,15 @@ proc instGenericConvertersSons*(c: PContext, n: PNode, x: TCandidate) = for i in 1..