minor bugfix for transf pass after lambda-lifting

This commit is contained in:
Araq 2015-09-21 15:17:04 +02:00
commit c04e17aea3

View file

@ -139,7 +139,7 @@ proc transformVarSection(c: PTransf, v: PNode): PTransNode =
if it.kind == nkCommentStmt: if it.kind == nkCommentStmt:
result[i] = PTransNode(it) result[i] = PTransNode(it)
elif it.kind == nkIdentDefs: elif it.kind == nkIdentDefs:
if it.sons[0].kind != nkSym: internalError(it.info, "transformVarSection") if it.sons[0].kind == nkSym:
internalAssert(it.len == 3) internalAssert(it.len == 3)
var newVar = copySym(it.sons[0].sym) var newVar = copySym(it.sons[0].sym)
incl(newVar.flags, sfFromGeneric) incl(newVar.flags, sfFromGeneric)
@ -156,6 +156,9 @@ proc transformVarSection(c: PTransf, v: PNode): PTransNode =
defs[2] = transform(c, it.sons[2]) defs[2] = transform(c, it.sons[2])
newVar.ast = defs[2].PNode newVar.ast = defs[2].PNode
result[i] = defs result[i] = defs
else:
# has been transformed into 'param.x' for closure iterators, so keep it:
result[i] = PTransNode(it)
else: else:
if it.kind != nkVarTuple: if it.kind != nkVarTuple:
internalError(it.info, "transformVarSection: not nkVarTuple") internalError(it.info, "transformVarSection: not nkVarTuple")