array iterator does not track a growing array #124

Open
Siddhant opened this Issue May 21, 2012 · 1 comment

Comments

Projects
None yet
2 participants

The following loop should iterate infinitely, but it does not:

my @array = 1, 2;

for @array -> $n {
    $n.say;
    @array.push: $n + 2;
}

say @rray;

niecza version (last commit in my clone of niecza): fb775fb

bug discovered: http://irclog.perlgeek.de/perl6/2012-05-21#i_5619326

Owner

sorear commented May 25, 2012

Following patch works, but I'm not applying it because it makes for loops over arrays ~90 times slower. I will revisit this when I find a better approach.

http://gist.github.com/2786465

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment