This commit is contained in:
Araq 2013-06-27 08:19:03 +02:00
commit 8d4f5038d0
2 changed files with 10 additions and 0 deletions

View file

@ -1290,6 +1290,7 @@ proc newAnonSym(kind: TSymKind, info: TLineInfo,
proc semExpandToAst(c: PContext, n: PNode): PNode = proc semExpandToAst(c: PContext, n: PNode): PNode =
var macroCall = n[1] var macroCall = n[1]
var expandedSym = expectMacroOrTemplateCall(c, macroCall) var expandedSym = expectMacroOrTemplateCall(c, macroCall)
if expandedSym.kind == skError: return n
macroCall.sons[0] = newSymNode(expandedSym, macroCall.info) macroCall.sons[0] = newSymNode(expandedSym, macroCall.info)
markUsed(n, expandedSym) markUsed(n, expandedSym)

View file

@ -15,3 +15,12 @@ else:
return tkUnknown return tkUnknown
case_token: inc i case_token: inc i
#bug #488
macro foo: stmt =
var exp = newCall("whatwhat", newIntLitNode(1))
if compiles(getAst(exp)): return exp
else: echo "Does not compute!"
foo()