summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2015-12-29 01:59:36 +0100
committerAndreas Rumpf <rumpf_a@web.de>2015-12-29 01:59:36 +0100
commit870b03707b17819defec79149cc3748d15ef57e4 (patch)
tree073d1833aece4fde2a914a4d966466ac097254ec
parent57149a47947cb9f8efc9addff9c92a0c39baa6ff (diff)
downloadNim-870b03707b17819defec79149cc3748d15ef57e4.tar.gz
bootstrapping works again
-rw-r--r--compiler/lambdalifting.nim6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/lambdalifting.nim b/compiler/lambdalifting.nim
index b7af99c3e..4ccaadc0d 100644
--- a/compiler/lambdalifting.nim
+++ b/compiler/lambdalifting.nim
@@ -608,8 +608,10 @@ proc liftCapturedVars(n: PNode; owner: PSym; d: DetectionPass;
   of nkProcDef, nkMethodDef, nkConverterDef, nkMacroDef:
     discard
   of nkLambdaKinds, nkIteratorDef:
-    if n.typ != nil:
-      discard liftCapturedVars(n[namePos], owner, d, c)
+    if n.typ != nil and n[namePos].kind == nkSym:
+      let m = newSymNode(n[namePos].sym)
+      m.typ = n.typ
+      result = liftCapturedVars(m, owner, d, c)
   else:
     if owner.isIterator and n.kind == nkYieldStmt:
       result = transformYield(n, owner, d, c)