# New Ticket Created by "Carl Mäsak" # Please include the string: [perl #74488] # in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=74488 >
<masak> I found the disastrous bug. <masak> it took all of yesterday evening. and half of the night. <jnthn> How disasterous is it? <masak> jnthn: it's bad. <jnthn> Damm. <jnthn> Got a short test case? <moritz_> do tell. <jnthn> We've already been burnt by that. <masak> rakudo: my $t = 0; sub foo { my @a; my &bar = { say +...@a }; unless $t++ { foo; push @a, "OH HAI"; say +...@a; bar; } }; foo <p6eval> rakudo 842d2b: OUTPUT«10» <masak> alpha: my $t = 0; sub foo { my @a; my &bar = { say +...@a }; unless $t++ { foo; push @a, "OH HAI"; say +...@a; bar; } }; foo <p6eval> alpha 30e0ed: OUTPUT«11» * masak submits rakudobug <masak> I'll five you a minute or so :) <moritz_> soo... &bar has some wrong lexical @a? <masak> rakudo: my $t = 0; sub foo { my @a; my &bar = { say @a.WHICH }; unless $t++ { foo; push @a, "OH HAI"; say @a.WHICH; bar; } }; foo <p6eval> rakudo 842d2b: OUTPUT«8796916888746296» <masak> yep. <masak> alpha: my $t = 0; sub foo { my @a; my &bar = { say @a.WHICH }; unless $t++ { foo; push @a, "OH HAI"; say @a.WHICH; bar; } }; foo <p6eval> alpha 30e0ed: OUTPUT«4740509414053647405094140536» <masak> the @a in &bar gets bound to the @a in the foo call called by foo, not the foo call called by the outermost scope. <moritz_> maybe related to RT #73034, which also discusses variable sharing in closures * masak looks <moritz_> that one is responsible for the man-or-boy test not working in master <moritz_> Knuth++ <masak> I have no way to know whether mine is the same, so I'll go ahead and submit it anyway. <masak> they do look related. <moritz_> maybe include a reference to that ticket <masak> *nod* <masak> until I can find a workaround, this bug blocks the conversion of GGE to master. <jnthn> pmichaud++ did at one point have a patch that got man or boy passing again in master. <moritz_> so why didn't he commit? did it break everything else? <jnthn> Yes. <masak> to heck with everything else! <jnthn> rakudo: my $t = 0; sub foo { my @a; my &bar = pir::clone({ say +...@a }); unless $t++ { foo; push @a, "OH HAI"; say +...@a; bar; } }; foo <p6eval> rakudo 842d2b: OUTPUT«11» <masak> jnthn++ <masak> there's the workaround. (eww!) :)