fix the do notation when used with procs
This commit is contained in:
parent
03172bef6f
commit
987b522071
7 changed files with 59 additions and 11 deletions
|
|
@ -90,7 +90,11 @@ proc evalTemplateArgs(n: PNode, s: PSym; fromHlo: bool): PNode =
|
|||
|
||||
result = newNodeI(nkArgList, n.info)
|
||||
for i in 1 .. givenRegularParams:
|
||||
result.addSon n.sons[i]
|
||||
let p = n[i]
|
||||
if p != nil and p.kind == nkDo and s.typ.sons[i].kind in {tyStmt, tyExpr}:
|
||||
result.addSon p[bodyPos]
|
||||
else:
|
||||
result.addSon p
|
||||
|
||||
# handle parameters with default values, which were
|
||||
# not supplied by the user
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue