mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-18 02:27:10 +00:00
fixes #488
This commit is contained in:
@@ -1290,6 +1290,7 @@ proc newAnonSym(kind: TSymKind, info: TLineInfo,
|
||||
proc semExpandToAst(c: PContext, n: PNode): PNode =
|
||||
var macroCall = n[1]
|
||||
var expandedSym = expectMacroOrTemplateCall(c, macroCall)
|
||||
if expandedSym.kind == skError: return n
|
||||
|
||||
macroCall.sons[0] = newSymNode(expandedSym, macroCall.info)
|
||||
markUsed(n, expandedSym)
|
||||
|
||||
@@ -15,3 +15,12 @@ else:
|
||||
return tkUnknown
|
||||
|
||||
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()
|
||||
|
||||
Reference in New Issue
Block a user