Skip Menu |
Report information
Id: 122990
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: masak <cmasak [at] gmail.com>
Cc:
AdminCc:

Severity: (no value)
Tag: Bug
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Date: Thu, 16 Oct 2014 19:43:14 +0200
Subject: [BUG] Matching an integer capture against a signature with a native integer coercing to Str fails (when it should succeed) in Rakudo
To: rakudobug [...] perl.org
From: Carl Mäsak <cmasak [...] gmail.com>
Download (untitled) / with headers
text/plain 952b
<masak> I'm about to close https://rt.perl.org/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.
Download (untitled) / with headers
text/plain 1.8k
On Thu, 16 Oct 2014 10:43:27 -0700, masak wrote: Show quoted text
> <masak> I'm about to close > https://rt.perl.org/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␤»


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org