diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2015-12-30 00:47:15 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2015-12-30 00:47:15 +0100 |
commit | 9cc066d99ddbeffb3e6fdacbe8f9159131bb942c (patch) | |
tree | 065abb2b56182d916d373738b5d59b36a0ed9e00 | |
parent | 250e81cedad70c861bf0b18c12b6f23e79388574 (diff) | |
download | Nim-9cc066d99ddbeffb3e6fdacbe8f9159131bb942c.tar.gz |
closure iterators sometimes work
-rw-r--r-- | compiler/lambdalifting.nim | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/lambdalifting.nim b/compiler/lambdalifting.nim index 1467d9594..5bdf73c5f 100644 --- a/compiler/lambdalifting.nim +++ b/compiler/lambdalifting.nim @@ -359,7 +359,8 @@ proc detectCapturedVars(n: PNode; owner: PSym; c: var DetectionPass) = # create required upFields: var w = owner.skipGenericOwner if isInnerProc(w): - while w != nil and w.kind != skModule and ow != w: + let last = if ow.isIterator: ow.skipGenericOwner else: ow + while w != nil and w.kind != skModule and last != w: discard """ proc outer = var a, b: int @@ -413,7 +414,7 @@ proc accessViaEnvParam(n: PNode; owner: PSym): PNode = let upField = lookupInRecord(obj.n, getIdent(upName)) if upField == nil: break access = rawIndirectAccess(access, upField, n.info) - localError(n.info, "internal error: no environment parameter set") + localError(n.info, "internal error: environment misses: " & s.name.s) result = n proc rawClosureCreation(env: PNode; owner: PSym; |