fix the do notation when used with procs

This commit is contained in:
Zahary Karadjov 2017-04-09 22:59:24 +03:00
commit 987b522071
7 changed files with 59 additions and 11 deletions

View file

@ -1599,7 +1599,8 @@ proc setupMacroParam(x: PNode, typ: PType): TFullReg =
putIntoReg(result, x)
else:
result.kind = rkNode
var n = x
var n = if typ.kind in {tyStmt,tyExpr} and x.kind == nkDo: x[bodyPos]
else: x
if n.kind in {nkHiddenSubConv, nkHiddenStdConv}: n = n.sons[1]
n = n.canonValue
n.flags.incl nfIsRef