[perl #130575] [BUG] Variables inside a try {} block used with `andthen` don't always get updated to correct values

[email protected] ("Zoffix Znet via RT")
Newsgroups perl.perl6.compiler
Message-ID <[email protected]>
On Tue, 17 Jan 2017 10:04:11 -0800, [email protected] wrote:
> <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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.