[perl #132172] [BUG] `orelse` + block in a string gets the wrong $_

[email protected] ("Zoffix Znet via RT")
Newsgroups perl.perl6.compiler
Message-ID <[email protected]>
On Wed, 27 Sep 2017 07:09:16 -0700, [email protected] wrote:
> 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
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.