From 2d0ee2c8abcfa45987c8e918298d2e991ffd7454 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Mon, 20 Mar 2017 11:44:58 +0100 Subject: [PATCH] mark symbols in getAst context as used --- compiler/semexprs.nim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 9c4d5bcd28..32f74e0509 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -1623,7 +1623,11 @@ proc semExpandToAst(c: PContext, n: PNode): PNode = elif cands >= 2: localError(n.info, "ambiguous symbol in 'getAst' context: " & $macroCall) else: - macroCall.sons[0] = newSymNode(cand) + let info = macroCall.sons[0].info + macroCall.sons[0] = newSymNode(cand, info) + markUsed(info, cand, c.graph.usageSym) + styleCheckUse(info, cand) + # we just perform overloading resolution here: #n.sons[1] = semOverloadedCall(c, macroCall, macroCall, {skTemplate, skMacro}) else: