Skip Menu |
Report information
Id: 132172
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] `orelse` + block in a string gets the wrong $_
Download (untitled) / with headers
text/plain 743b
Here, instead of the Failure, the $_ is an Any: 13:59 m: sub x { my $ver = .lines.uc with "blazr".IO.open orelse note "meow {.exception.message}" and return 42; "meow$ver" }; dd x 13:59 camelia rakudo-moar 9af560: OUTPUT: «No such method 'exception' for invocant of type 'Any'␤ in sub x at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤» But if we remove the block, then we get the right $_: 14:00 Zoffix m: sub x { my $ver = .lines.uc with "blazr".IO.open orelse note "meow " ~ .exception.message and return 42; "meow$ver" }; dd x 14:00 camelia rakudo-moar 9af560: OUTPUT: «meow Failed to open file /home/camelia/blazr: No such file or directory␤42␤» It's possible this issue also affects andthen and notandthen
RT-Send-CC: perl6-compiler [...] perl.org
On Wed, 27 Sep 2017 07:09:16 -0700, cpan@zoffix.com wrote: Show quoted text
> Here, instead of the Failure, the $_ is an Any: > > 13:59 m: sub x { my $ver = .lines.uc with "blazr".IO.open > orelse note "meow {.exception.message}" and return 42; "meow$ver" }; > dd x > 13:59 camelia rakudo-moar 9af560: OUTPUT: «No such method > 'exception' for invocant of type 'Any'␤ in sub x at <tmp> line 1␤ in > block <unit> at <tmp> line 1␤␤» > > But if we remove the block, then we get the right $_: > 14:00 Zoffix m: sub x { my $ver = .lines.uc with "blazr".IO.open > orelse note "meow " ~ .exception.message and return 42; "meow$ver" }; > dd x > 14:00 camelia rakudo-moar 9af560: OUTPUT: «meow Failed to > open file /home/camelia/blazr: No such file or directory␤42␤» > > > It's possible this issue also affects andthen and notandthen
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