Skip Menu |
Report information
Id: 131251
Status: resolved
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: bri [at] abrij.org
Cc:
AdminCc:

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Subject: Useless use warning triggered on assignment forms of reverse metaops
Download (untitled) / with headers
text/plain 464b
An R metaop using the bracket notation to retain lvalueness of the lvalue side triggers a "useless use" warning in sink context, and shouldn't. (10:00:22 PM) skids: m: my $a = "H"; say $a [R~]= "T"; $a.say; $a [R~]= "W"; $a.say (10:00:22 PM) camelia: rakudo-moar f4cbdb: OUTPUT: «Potential difficulties:␤ Useless use of [R~]= in sink context␤ at <tmp>:1␤ ------> $a = "H"; say $a [R~]= "T"; $a.say; $a ⏏[R~]= "W"; $a.say␤TH␤TH␤WTH␤»
Download (untitled) / with headers
text/plain 124b
This also happens with other metaops than R, like [Z+]=, [X+]=, and also [S+]= (which admittedly doesn't do sensible things)
RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 999b
On Wed, 03 May 2017 19:14:23 -0700, bri@abrij.org wrote: Show quoted text
> > An R metaop using the bracket notation to retain lvalueness of the > lvalue side > triggers a "useless use" warning in sink context, and shouldn't. > > (10:00:22 PM) skids: m: my $a = "H"; say $a [R~]= "T"; $a.say; $a > [R~]= "W"; $a.say > (10:00:22 PM) camelia: rakudo-moar f4cbdb: OUTPUT: «Potential > difficulties:␤ Useless use of [R~]= in sink context␤ at <tmp>:1␤ > ------> $a = "H"; say $a [R~]= "T"; $a.say; $a ⏏[R~]= "W"; > $a.say␤TH␤TH␤WTH␤»
Using fix: Fix spurious useless-use warnings in metaop+metaassign op Using test: Fix spurious useless-use warnings in metaop+metaassign op Thank you for the report. This is now fixed. Fix: https://github.com/rakudo/rakudo/commit/cad66b72d57637f Test: https://github.com/rakudo/rakudo/commit/cad66b72d57637f (P.S.: couldn't figure out a combination with `S` meta op that did not explode about missing CALL-ME methods, so I didn't cover that one in tests)


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