Skip Menu |
Report information
Id: 131499
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] Incorrect useless use warning in `andthen`/`notandthen`/`orelse`
In none of these cases is the use of variables actually useless: <Zoffix__> m: my ($sensor1, $sensor2, $sensor3); $sensor1 notandthen $sensor2 notandthen $sensor3 notandthen 'did not find a working sensor!'.say; <camelia> rakudo-moar 64e898: OUTPUT: «WARNINGS for <tmp>:␤Useless use of $sensor3 in sink context (line 1)␤Useless use of $sensor2 in sink context (line 1)␤did not find a working sensor!␤» <Zoffix__> m: my ($sensor1, $sensor2, $sensor3) := (1, 2, 3); $sensor1 andthen $sensor2 andthen $sensor3 andthen 'did not find a working sensor!'.say; <camelia> rakudo-moar 64e898: OUTPUT: «WARNINGS for <tmp>:␤Useless use of $sensor3 in sink context (line 1)␤Useless use of $sensor2 in sink context (line 1)␤did not find a working sensor!␤» <Zoffix__> m: m: my ($sensor1, $sensor2, $sensor3); $sensor1 orelse $sensor2 orelse $sensor3 orelse 'did not find a working sensor!'.say; <camelia> rakudo-moar 64e898: OUTPUT: «WARNINGS for <tmp>:␤Useless use of $sensor3 in sink context (line 1)␤Useless use of $sensor2 in sink context (line 1)␤did not find a working sensor!␤»


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