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

Incorrect useless use warning when WhateverCode is passed as arg to Callable #6319

Closed
p6rt opened this issue Jun 3, 2017 · 6 comments
Closed
Labels

Comments

@p6rt
Copy link

p6rt commented Jun 3, 2017

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

Searchable as RT131502$

@p6rt
Copy link
Author

p6rt commented Jun 3, 2017

From @zoffixznet

The warning lies; this use isn't useless​:

  <Zoffix__> m​: -> +@​foo { say @​foo.head.(41) }(* == 42)
  <camelia> rakudo-moar 64e898​: OUTPUT​: «WARNINGS for <tmp>​:␤Useless use of "==" in expression "* == 42" in sink context (line 1)␤False␤»
  <Zoffix__> m​: -> +@​foo { say @​foo.head.(42) }(* == 42)
  <camelia> rakudo-moar 64e898​: OUTPUT​: «WARNINGS for <tmp>​:␤Useless use of "==" in expression "* == 42" in sink context (line 1)␤True␤»

Appears to only happen when the Callable is invoked right away; this version is fine​:

  <Zoffix__> m​: sub foo (+@​foo) { say @​foo.head.(42) }; foo(* == 42)
  <camelia> rakudo-moar 64e898​: OUTPUT​: «True␤»

@p6rt
Copy link
Author

p6rt commented Jun 3, 2017

From @zoffixznet

Oops. Long day. I meant WhateverCode is passed, not Junction.

@p6rt
Copy link
Author

p6rt commented Sep 15, 2017

From @skids

On Sat, 03 Jun 2017 12​:08​:50 -0700, cpan@​zoffix.com wrote​:

Oops. Long day. I meant WhateverCode is passed, not Junction.

Fudged tests preemptively added to S02-types/whatever.t in roast commit 4b2fef409.

@p6rt
Copy link
Author

p6rt commented Sep 15, 2017

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

@p6rt
Copy link
Author

p6rt commented Jan 10, 2018

From @zoffixznet

On Sat, 03 Jun 2017 12​:07​:37 -0700, cpan@​zoffix.com wrote​:

The warning lies; this use isn't useless​:

<Zoffix__> m​: -> +@​foo { say @​foo.head.(41) }(* == 42)
<camelia> rakudo-moar 64e898​: OUTPUT​: «WARNINGS for <tmp>​:␤Useless use
of "==" in expression "* == 42" in sink context (line 1)␤False␤»
<Zoffix__> m​: -> +@​foo { say @​foo.head.(42) }(* == 42)
<camelia> rakudo-moar 64e898​: OUTPUT​: «WARNINGS for <tmp>​:␤Useless use
of "==" in expression "* == 42" in sink context (line 1)␤True␤»

Appears to only happen when the Callable is invoked right away; this
version is fine​:

<Zoffix__> m​: sub foo (+@​foo) { say @​foo.head.(42) }; foo(* == 42)
<camelia> rakudo-moar 64e898​: OUTPUT​: «True␤»

Thank you for the report. This is now fixed.

Fix​: rakudo/rakudo@fa136be2ca
Test unfudge​: Raku/roast@754e377b53

@p6rt p6rt closed this as completed Jan 10, 2018
@p6rt
Copy link
Author

p6rt commented Jan 10, 2018

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

@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant