Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Useless use warning triggered on assignment forms of reverse metaops #6221

Closed
p6rt opened this issue May 4, 2017 · 5 comments
Closed

Useless use warning triggered on assignment forms of reverse metaops #6221

p6rt opened this issue May 4, 2017 · 5 comments

Comments

@p6rt
Copy link

p6rt commented May 4, 2017

Migrated from rt.perl.org#131251 (status was 'resolved')

Searchable as RT131251$

@p6rt
Copy link
Author

p6rt commented May 4, 2017

From @skids

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␤»

@p6rt
Copy link
Author

p6rt commented Sep 29, 2017

From @timo

This also happens with other metaops than R, like [Z+]=, [X+]=, and also [S+]= (which admittedly doesn't do sensible things)

@p6rt
Copy link
Author

p6rt commented Sep 29, 2017

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Jan 12, 2018

From @zoffixznet

On Wed, 03 May 2017 19​:14​:23 -0700, bri@​abrij.org wrote​:

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​: rakudo/rakudo@cad66b72d57637f
Test​: rakudo/rakudo@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)

@p6rt
Copy link
Author

p6rt commented Jan 12, 2018

@zoffixznet - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Jan 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant