fixes #488
This commit is contained in:
parent
ed56b8c173
commit
8d4f5038d0
2 changed files with 10 additions and 0 deletions
|
|
@ -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)
|
||||||
|
|
|
||||||
|
|
@ -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()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue