fixes #534
This commit is contained in:
parent
015b814e6a
commit
5c32156a71
2 changed files with 8 additions and 3 deletions
|
|
@ -1361,7 +1361,9 @@ proc semQuoteAst(c: PContext, n: PNode): PNode =
|
||||||
ids = newSeq[PNode]()
|
ids = newSeq[PNode]()
|
||||||
# this will store the generated param names
|
# this will store the generated param names
|
||||||
|
|
||||||
internalAssert doBlk.kind == nkDo
|
if doBlk.kind != nkDo:
|
||||||
|
LocalError(n.info, errXExpected, "block")
|
||||||
|
|
||||||
processQuotations(doBlk.sons[bodyPos], op, quotes, ids)
|
processQuotations(doBlk.sons[bodyPos], op, quotes, ids)
|
||||||
|
|
||||||
doBlk.sons[namePos] = newAnonSym(skTemplate, n.info).newSymNode
|
doBlk.sons[namePos] = newAnonSym(skTemplate, n.info).newSymNode
|
||||||
|
|
|
||||||
|
|
@ -448,8 +448,11 @@ proc track(tracked: PEffects, n: PNode) =
|
||||||
# p's effects are ours too:
|
# p's effects are ours too:
|
||||||
let a = n.sons[0]
|
let a = n.sons[0]
|
||||||
let op = a.typ
|
let op = a.typ
|
||||||
if op != nil and op.kind == tyProc:
|
# XXX: in rare situations, templates and macros will reach here after
|
||||||
InternalAssert op.n.sons[0].kind == nkEffectList
|
# calling getAst(templateOrMacro()). Currently, templates and macros
|
||||||
|
# are indistinguishable from normal procs (both have tyProc type) and
|
||||||
|
# we can detect them only by cheking for attached nkEffectList.
|
||||||
|
if op != nil and op.kind == tyProc and op.n.sons[0].kind == nkEffectList:
|
||||||
var effectList = op.n.sons[0]
|
var effectList = op.n.sons[0]
|
||||||
if a.kind == nkSym and a.sym.kind == skMethod:
|
if a.kind == nkSym and a.sym.kind == skMethod:
|
||||||
propagateEffects(tracked, n, a.sym)
|
propagateEffects(tracked, n, a.sym)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue