Files
Nim/tests/iter
Yuriy Glukhov 5fa96ef270 Fixes #3824, fixes #19154, and hopefully #24094. Re-applies #23787. (#24316)
The first commit reverts the revert of #23787.
The second fixes lambdalifting in convolutedly nested
closures/closureiters. This is considered to be the reason of #24094,
though I can't tell for sure, as I was not able to reproduce #24094 for
complicated but irrelevant reasons. Therefore I ask @jmgomez, @metagn or
anyone who could reproduce it to try it again with this PR.

I would suggest this PR to not be squashed if possible, as the history
is already messy enough.

Some theory behind the lambdalifting fix:
- A closureiter that captures anything outside its body will always have
`:up` in its env. This property is now used as a trigger to lift any
proc that captures such a closureiter.
- Instantiating a closureiter involves filling out its `:up`, which was
previously done incorrectly. The fixed algorithm is to use "current" env
if it is the owner of the iter declaration, or traverse through `:up`s
of env param until the common ancestor is found.

---------

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2024-10-18 10:36:41 +02:00
..
2021-03-24 08:49:05 +01:00
2015-01-11 13:51:30 +01:00
2019-05-03 23:43:41 +02:00
2014-01-13 02:10:03 +01:00
2019-11-05 11:05:46 +01:00
2019-05-30 11:18:17 +02:00
2019-11-05 16:55:08 +01:00
2019-05-13 20:50:21 +02:00
2019-05-13 20:50:21 +02:00
2019-05-13 20:50:21 +02:00
2018-12-11 21:23:21 +01:00
2014-01-13 02:10:03 +01:00
2015-07-14 01:37:07 +02:00