summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2015-02-08 14:15:02 +0100
committerAraq <rumpf_a@web.de>2015-02-08 14:15:02 +0100
commitada0f14711d3eff140f05f8a845cff5d489a71fd (patch)
treee3337ea1f321cbcfef6f72c5689bb634000a4771 /compiler
parentc91ca82a43917163f00cf86e59d80a8909dca80a (diff)
downloadNim-ada0f14711d3eff140f05f8a845cff5d489a71fd.tar.gz
fixes #2073
Diffstat (limited to 'compiler')
-rw-r--r--compiler/semstmts.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim
index b4790e421..6e5b272de 100644
--- a/compiler/semstmts.nim
+++ b/compiler/semstmts.nim
@@ -825,9 +825,9 @@ proc semLambda(c: PContext, n: PNode, flags: TExprFlags): PNode =
     if gp.len == 0 or (gp.len == 1 and tfRetType in gp[0].typ.flags):
       pushProcCon(c, s)
       addResult(c, s.typ.sons[0], n.info, skProc)
+      addResultNode(c, n)
       let semBody = hloBody(c, semProcBody(c, n.sons[bodyPos]))
       n.sons[bodyPos] = transformBody(c.module, semBody, s)
-      addResultNode(c, n)
       popProcCon(c)
     elif efOperand notin flags:
       localError(n.info, errGenericLambdaNotAllowed)
@@ -860,9 +860,9 @@ proc semInferredLambda(c: PContext, pt: TIdTable, n: PNode): PNode =
   addParams(c, n.typ.n, skProc)
   pushProcCon(c, s)
   addResult(c, n.typ.sons[0], n.info, skProc)
+  addResultNode(c, n)
   let semBody = hloBody(c, semProcBody(c, n.sons[bodyPos]))
   n.sons[bodyPos] = transformBody(c.module, semBody, n.sons[namePos].sym)
-  addResultNode(c, n)
   popProcCon(c)
   popOwner()
   closeScope(c)