Skip Menu |
Report information
Id: 131622
Status: new
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] Failures don't get sunk when last in for loop
Download (untitled) / with headers
text/plain 599b
The .map gets special treatment if it's the last item of a for loop and it gets sunk so that it gets evaluated: m: for 1 { ^2 .map: *.say } rakudo-moar 86e7b2: OUTPUT: «0␤1␤» We need to add the same special treatment for Failures, as they fail to explode because they never get sunk: m: for 1 { +'x' } rakudo-moar 86e7b2: OUTPUT: «WARNINGS for <tmp>:␤Useless use of "+" in expression "+'x'" in sink context (line 1)␤» m: +'x' for 1 rakudo-moar 86e7b2: OUTPUT: «WARNINGS for <tmp>:␤Useless use of "+" in expression "+'x'" in sink context (line 1)␤»
Download (untitled) / with headers
text/plain 468b
More examples: <Zoffix__> m: sub mv { for 1 { Failure.new }; 42 }(); <camelia> rakudo-moar 765dd6944: OUTPUT: «Failed␤ in sub mv at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤» <Zoffix__> m: sub mv { for 1 { +'x' }; 42 }(); <camelia> rakudo-moar 765dd6944: OUTPUT: «WARNINGS for <tmp>:␤Useless use of "+" in expression "+'x'" in sink context (line 1)␤» The first one manages to sink and explode Failure, the second one does not.


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