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

Junction:D ~~ Bool seems to always return False #5925

Closed
p6rt opened this issue Dec 28, 2016 · 3 comments
Closed

Junction:D ~~ Bool seems to always return False #5925

p6rt opened this issue Dec 28, 2016 · 3 comments

Comments

@p6rt
Copy link

p6rt commented Dec 28, 2016

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

Searchable as RT130426$

@p6rt
Copy link
Author

p6rt commented Dec 28, 2016

From @zoffixznet

Seems regardless of what Junction I use, smartmatch against Bool type object always returns false, despite
individual items smartmatching as true​:

  <ZoffixW> m​: say True ~~ Bool
  <camelia> rakudo-moar db1836​: OUTPUT«True␤»
  <ZoffixW> m​: say False ~~ Bool
  <camelia> rakudo-moar db1836​: OUTPUT«True␤»
  <ZoffixW> m​: say [False, True].all ~~ Bool
  <camelia> rakudo-moar db1836​: OUTPUT«False␤»
  <ZoffixW> m​: say [False, True].any ~~ Bool
  <camelia> rakudo-moar db1836​: OUTPUT«False␤»
  <ZoffixW> m​: say [False, True].none ~~ Bool
  <camelia> rakudo-moar db1836​: OUTPUT«False␤»

And despite them smartmatching correctly against some other type object, like an Int​:

  <ZoffixW> m​: say [False, True].none ~~ Int
  <camelia> rakudo-moar db1836​: OUTPUT«False␤»
  <ZoffixW> m​: say [42].all ~~ Int
  <camelia> rakudo-moar db1836​: OUTPUT«True␤»
  <ZoffixW> m​: say Bool ~~ Int
  <camelia> rakudo-moar db1836​: OUTPUT«True␤»
  <ZoffixW> m​: say [False, True].all ~~ Int
  <camelia> rakudo-moar db1836​: OUTPUT«True␤»

@p6rt
Copy link
Author

p6rt commented Dec 30, 2016

From @zoffixznet

On Wed, 28 Dec 2016 11​:46​:28 -0800, cpan@​zoffix.com wrote​:

Seems regardless of what Junction I use, smartmatch against Bool type
object always returns false, despite
individual items smartmatching as true​:

<ZoffixW> m​: say True ~~ Bool
<camelia> rakudo-moar db1836​: OUTPUT«True␤»
<ZoffixW> m​: say False ~~ Bool
<camelia> rakudo-moar db1836​: OUTPUT«True␤»
<ZoffixW> m​: say [False, True].all ~~ Bool
<camelia> rakudo-moar db1836​: OUTPUT«False␤»
<ZoffixW> m​: say [False, True].any ~~ Bool
<camelia> rakudo-moar db1836​: OUTPUT«False␤»
<ZoffixW> m​: say [False, True].none ~~ Bool
<camelia> rakudo-moar db1836​: OUTPUT«False␤»

And despite them smartmatching correctly against some other type
object, like an Int​:

<ZoffixW> m​: say [False, True].none ~~ Int
<camelia> rakudo-moar db1836​: OUTPUT«False␤»
<ZoffixW> m​: say [42].all ~~ Int
<camelia> rakudo-moar db1836​: OUTPUT«True␤»
<ZoffixW> m​: say Bool ~~ Int
<camelia> rakudo-moar db1836​: OUTPUT«True␤»
<ZoffixW> m​: say [False, True].all ~~ Int
<camelia> rakudo-moar db1836​: OUTPUT«True␤»

Thank you for the report. This is now fixed.

Fix​: rakudo/rakudo@9fc616f875
Tests​: Raku/roast@34ae318971

@p6rt
Copy link
Author

p6rt commented Dec 30, 2016

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

@p6rt p6rt closed this as completed Dec 30, 2016
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