Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variables inside a try {} block used with `andthen` don't always get updated to correct values #6008

Closed
p6rt opened this issue Jan 17, 2017 · 3 comments
Labels
Bug

Comments

@p6rt
Copy link

@p6rt p6rt commented Jan 17, 2017

Migrated from rt.perl.org#130575 (status was 'resolved')

Searchable as RT130575$

@p6rt
Copy link
Author

@p6rt p6rt commented Jan 17, 2017

From @zoffixznet

<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

@p6rt
Copy link
Author

@p6rt p6rt commented Jan 26, 2018

From @zoffixznet

On Tue, 17 Jan 2017 10​:04​:11 -0800, cpan@​zoffix.com 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​: rakudo/rakudo@1ee89b5
Test​: Raku/roast@2f29987

@p6rt p6rt closed this Jan 26, 2018
@p6rt
Copy link
Author

@p6rt p6rt commented Jan 26, 2018

@zoffixznet - Status changed from 'new' to 'resolved'

@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.