Skip Menu |
Report information
Id: 130575
Status: resolved
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: cpan [at] zoffix.com
Cc:
AdminCc:

Severity: (no value)
Tag: Bug
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Subject: [BUG] Variables inside a try {} block used with `andthen` don't always get updated to correct values
Download (untitled) / with headers
text/plain 517b
<ZoffixW> m: sub itcavuc ($c) { (try say $c) andthen 42 }; itcavuc $_ for 2, 4, 6 <camelia> rakudo-moar 7d5bbe: OUTPUT«2␤4␤6␤» <ZoffixW> m: sub itcavuc ($c) { try {say $c} andthen 42 }; itcavuc $_ for 2, 4, 6 <camelia> rakudo-moar 7d5bbe: OUTPUT«2␤2␤4␤» The block `try {}` seems to have repeated `2` and missing `6` in the output. The bug seems to occur with a combination of a block form of `try` and `andthen` (which thunks) A few more cases: https://irclog.perlgeek.de/perl6/2017-01-17#i_13936831
RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 776b
On Tue, 17 Jan 2017 10:04:11 -0800, cpan@zoffix.com wrote: Show quoted text
> <ZoffixW> m: sub itcavuc ($c) { (try say $c) andthen 42 }; itcavuc $_ > for 2, 4, 6 > <camelia> rakudo-moar 7d5bbe: OUTPUT«2␤4␤6␤» > <ZoffixW> m: sub itcavuc ($c) { try {say $c} andthen 42 }; itcavuc $_ > for 2, 4, 6 > <camelia> rakudo-moar 7d5bbe: OUTPUT«2␤2␤4␤» > > The block `try {}` seems to have repeated `2` and missing `6` in the > output. The bug seems to occur with a combination of a block form of > `try` and `andthen` (which thunks) > > A few more cases: https://irclog.perlgeek.de/perl6/2017-01- > 17#i_13936831
Thank you for the report. This is now fixed. Fix: https://github.com/rakudo/rakudo/commit/1ee89b54074e80c Test: https://github.com/perl6/roast/commit/2f2998733a2d8132c


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org