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

Matching an integer capture against a signature with a native integer coercing to Str fails (when it should succeed) in Rakudo #3556

Open
p6rt opened this issue Oct 16, 2014 · 3 comments
Labels
Bug

Comments

@p6rt
Copy link

@p6rt p6rt commented Oct 16, 2014

Migrated from rt.perl.org#122990 (status was 'open')

Searchable as RT122990$

@p6rt
Copy link
Author

@p6rt p6rt commented Oct 16, 2014

From @masak

<masak> I'm about to close
https://rt-archive.perl.org/perl6/Ticket/Display.html?id=118581 (because it no
longer segfaults).
<masak> just curious​: what *should* this return?
<masak> m​: say \(1) ~~ :(1)
<camelia> rakudo-moar 329ed9​: OUTPUT«True␤»
<masak> m​: say \(1) ~~ :(Int)
<camelia> rakudo-moar 329ed9​: OUTPUT«True␤»
<masak> m​: say \(1) ~~ :(int)
<camelia> rakudo-moar 329ed9​: OUTPUT«True␤»
<masak> m​: say \(1) ~~ :(int $x)
<camelia> rakudo-moar 329ed9​: OUTPUT«True␤»
<Mouq> m​: say \(1) ~~ :($x as Str)
<camelia> rakudo-moar 329ed9​: OUTPUT«True␤»
<masak> m​: say \(1) ~~ :(int $x as Str)
<camelia> rakudo-moar 329ed9​: OUTPUT«False␤»
<masak> m​: say \(1) ~~ :(int as Str)
<camelia> rakudo-moar 329ed9​: OUTPUT«False␤»
<masak> yeah, that feels wrong. :)
* masak closes the old ticket and opens a new one
<bartolin> sounds good, masak++

I'd expect the two "False" results above to be "True", for consistency
with the ones that *are* True.

@p6rt
Copy link
Author

@p6rt p6rt commented May 13, 2017

From @MasterDuke17

On Thu, 16 Oct 2014 10​:43​:27 -0700, masak wrote​:

<masak> I'm about to close
https://rt-archive.perl.org/perl6/Ticket/Display.html?id=118581 (because it no
longer segfaults).
<masak> just curious​: what *should* this return?
<masak> m​: say \(1) ~~ :(1)
<camelia> rakudo-moar 329ed9​: OUTPUT«True␤»
<masak> m​: say \(1) ~~ :(Int)
<camelia> rakudo-moar 329ed9​: OUTPUT«True␤»
<masak> m​: say \(1) ~~ :(int)
<camelia> rakudo-moar 329ed9​: OUTPUT«True␤»
<masak> m​: say \(1) ~~ :(int $x)
<camelia> rakudo-moar 329ed9​: OUTPUT«True␤»
<Mouq> m​: say \(1) ~~ :($x as Str)
<camelia> rakudo-moar 329ed9​: OUTPUT«True␤»
<masak> m​: say \(1) ~~ :(int $x as Str)
<camelia> rakudo-moar 329ed9​: OUTPUT«False␤»
<masak> m​: say \(1) ~~ :(int as Str)
<camelia> rakudo-moar 329ed9​: OUTPUT«False␤»
<masak> yeah, that feels wrong. :)
* masak closes the old ticket and opens a new one
<bartolin> sounds good, masak++

I'd expect the two "False" results above to be "True", for consistency
with the ones that *are* True.

The `as` syntax is now invalid, but the replacement coercion syntax `say \(1) ~~ :(Str(Int))` still gives inconsistent results​:

<MasterDuke_> m​: say \(1) ~~ :(Str(Int))
<+camelia> rakudo-moar b43ed1​: OUTPUT​: «True␤»
<MasterDuke_> m​: say \(1) ~~ :(Str(int))
<+camelia> rakudo-moar b43ed1​: OUTPUT​: «False␤»
<MasterDuke_> m​: say \(1) ~~ :(Int(int))
<+camelia> rakudo-moar b43ed1​: OUTPUT​: «False␤»
<MasterDuke_> m​: say \(1) ~~ :(Int(Int))
<+camelia> rakudo-moar b43ed1​: OUTPUT​: «True␤»
<MasterDuke_> m​: say \(1) ~~ :(int(int))
<+camelia> rakudo-moar b43ed1​: OUTPUT​: «False␤»
<MasterDuke_> m​: say \(1) ~~ :(int(Int))
<+camelia> rakudo-moar b43ed1​: OUTPUT​: «False␤»
<MasterDuke_> m​: say \(1) ~~ :(int)
<+camelia> rakudo-moar b43ed1​: OUTPUT​: «True␤»
<MasterDuke_> m​: say \(1) ~~ :(Int)
<+camelia> rakudo-moar b43ed1​: OUTPUT​: «True␤»

@p6rt
Copy link
Author

@p6rt p6rt commented May 13, 2017

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

@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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.