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 of useless use in smartmatch + block + try #6185

Closed
p6rt opened this issue Apr 8, 2017 · 7 comments
Closed

Useless use of useless use in smartmatch + block + try #6185

p6rt opened this issue Apr 8, 2017 · 7 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Apr 8, 2017

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

Searchable as RT131123$

@p6rt
Copy link
Author

p6rt commented Apr 8, 2017

From @zoffixznet

  <Zoffix_> m​: say so 42 ~~ { try $_ == 5 }
  <camelia> rakudo-moar af50e0​: OUTPUT​: «WARNINGS for <tmp>​:␤Useless use of "==" in expression "$_ == 5" in sink context (line 1)␤False␤»

  <Zoffix_> m​: say so 42 ~~ { $_ == 5 }
  <camelia> rakudo-moar af50e0​: OUTPUT​: «False␤»

@p6rt
Copy link
Author

p6rt commented Apr 14, 2017

From @FCO

Em Fri, 07 Apr 2017 19​:59​:42 -0700, cpan@​zoffix.com escreveu​:

<Zoffix_> m​: say so 42 ~~ { try $_ == 5 }
<camelia> rakudo-moar af50e0​: OUTPUT​: «WARNINGS for <tmp>​:␤Useless use
of "==" in expression "$_ == 5" in sink context (line 1)␤False␤»

<Zoffix_> m​: say so 42 ~~ { $_ == 5 }
<camelia> rakudo-moar af50e0​: OUTPUT​: «False␤»

I think the problem is only with block + try...

<SmokeMachine> m​: say {try 5 == 5}()
<camelia> combined, experimental evalbot rakudo-moar 7f73f9​: OUTPUT​: «WARNINGS for <tmp>​:␤Useless use of "==" in expression "5 == 5" in sink context (line 1)␤True␤»

@p6rt
Copy link
Author

p6rt commented Apr 14, 2017

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

@p6rt
Copy link
Author

p6rt commented Apr 22, 2017

From @FCO

Em Fri, 14 Apr 2017 14​:12​:54 -0700, fernandocorrea@​gmail.com escreveu​:

Em Fri, 07 Apr 2017 19​:59​:42 -0700, cpan@​zoffix.com escreveu​:

<Zoffix_> m​: say so 42 ~~ { try $_ == 5 }
<camelia> rakudo-moar af50e0​: OUTPUT​: «WARNINGS for <tmp>​:␤Useless
use
of "==" in expression "$_ == 5" in sink context (line 1)␤False␤»

<Zoffix_> m​: say so 42 ~~ { $_ == 5 }
<camelia> rakudo-moar af50e0​: OUTPUT​: «False␤»

I think the problem is only with block + try...

<SmokeMachine> m​: say {try 5 == 5}()
<camelia> combined, experimental evalbot rakudo-moar 7f73f9​: OUTPUT​:
«WARNINGS for <tmp>​:␤Useless use of "==" in expression "5 == 5" in
sink context (line 1)␤True␤»

try with a block doesn't warn​:

<SmokeMachine> Fernando Corrêa de Oliveira m​: say {try {5 == 5}}()
<•camelia> combined, experimental evalbot rakudo-moar 624fe8​: OUTPUT​: «True␤»

@p6rt
Copy link
Author

p6rt commented Jan 13, 2018

From @zoffixznet

On Fri, 14 Apr 2017 14​:12​:54 -0700, fernandocorrea@​gmail.com wrote​:

Em Fri, 07 Apr 2017 19​:59​:42 -0700, cpan@​zoffix.com escreveu​:

<Zoffix_> m​: say so 42 ~~ { try $_ == 5 }
<camelia> rakudo-moar af50e0​: OUTPUT​: «WARNINGS for <tmp>​:␤Useless
use
of "==" in expression "$_ == 5" in sink context (line 1)␤False␤»

<Zoffix_> m​: say so 42 ~~ { $_ == 5 }
<camelia> rakudo-moar af50e0​: OUTPUT​: «False␤»

I think the problem is only with block + try...

<SmokeMachine> m​: say {try 5 == 5}()
<camelia> combined, experimental evalbot rakudo-moar 7f73f9​: OUTPUT​:
«WARNINGS for <tmp>​:␤Useless use of "==" in expression "5 == 5" in
sink context (line 1)␤True␤»

Thank you for the report. This is now fixed.

Fix​: rakudo/rakudo@728acf597cf31fb
Test​: rakudo/rakudo@728acf597cf31fb

@p6rt
Copy link
Author

p6rt commented Jan 13, 2018

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

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

p6rt commented Jan 13, 2018

From @zoffixznet

On Sat, 13 Jan 2018 00​:09​:49 -0800, cpan@​zoffix.com wrote​:

On Fri, 14 Apr 2017 14​:12​:54 -0700, fernandocorrea@​gmail.com wrote​:

Em Fri, 07 Apr 2017 19​:59​:42 -0700, cpan@​zoffix.com escreveu​:

<Zoffix_> m​: say so 42 ~~ { try $_ == 5 }
<camelia> rakudo-moar af50e0​: OUTPUT​: «WARNINGS for <tmp>​:␤Useless
use
of "==" in expression "$_ == 5" in sink context (line 1)␤False␤»

<Zoffix_> m​: say so 42 ~~ { $_ == 5 }
<camelia> rakudo-moar af50e0​: OUTPUT​: «False␤»

I think the problem is only with block + try...

<SmokeMachine> m​: say {try 5 == 5}()
<camelia> combined, experimental evalbot rakudo-moar 7f73f9​: OUTPUT​:
«WARNINGS for <tmp>​:␤Useless use of "==" in expression "5 == 5" in
sink context (line 1)␤True␤»

Thank you for the report. This is now fixed.

Fix​: rakudo/rakudo@728acf597cf31fb
Test​: rakudo/rakudo@728acf597cf31fb

Correction​:

Fix​: rakudo/rakudo@ef2dc1b8ba7d45b
Test​: rakudo/rakudo@ef2dc1b8ba7d45b

@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