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

Owner: Nobody
Requestors: bri [at] abrij.org
Cc:
AdminCc:

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



Subject: Coercion type applied via role parameter fails to multi-dispatch
To: rakudobug [...] perl.org
Date: Sat, 28 Feb 2015 10:45:12 -0500
From: bri <bri [...] abrij.org>
Download (untitled) / with headers
text/plain 547b
(10:19:08 AM) skids: m: role g[::T $t] { multi method foo (T $a) { "OHAI".say }; multi method foo($a) { "ONOES".say }; }; g[Int(Str)].new.foo("100") (10:19:09 AM) camelia: rakudo-moar 35de75: OUTPUT«ONOES␤» (10:20:59 AM) jnthn: Bah, I knew somebody would try that :P (10:21:03 AM) vendethiel: *g* (10:21:31 AM) jnthn: I only did coercion types so far sufficient that we could migrate away from the deprecated "as" in sigs. (10:21:50 AM) jnthn: That one should be possible to make work, anyways. :) (10:22:08 AM) jnthn: It's just a bit fiddly.
Download (untitled) / with headers
text/plain 920b
On Sat, 28 Feb 2015 07:45:31 -0800, bri@abrij.org wrote: Show quoted text
> (10:19:08 AM) skids: m: role g[::T $t] { multi method foo (T $a) { > "OHAI".say }; multi method foo($a) { "ONOES".say }; }; > g[Int(Str)].new.foo("100") > (10:19:09 AM) camelia: rakudo-moar 35de75: OUTPUT«ONOES␤» > (10:20:59 AM) jnthn: Bah, I knew somebody would try that :P > (10:21:03 AM) vendethiel: *g* > (10:21:31 AM) jnthn: I only did coercion types so far sufficient that > we could migrate away from the deprecated "as" in sigs. > (10:21:50 AM) jnthn: That one should be possible to make work, > anyways. :) > (10:22:08 AM) jnthn: It's just a bit fiddly.
Still the same: $ perl6 -e 'role g[::T $t] { multi method foo (T $a) { "OHAI".say }; multi method foo($a) { "ONOES".say }; }; g[Int(Str)].new.foo("100")' ONOES $ perl6 --version This is Rakudo version 2017.11-44-g4a32089fd built on MoarVM version 2017.11-20-gd23f5ca16 implementing Perl 6.c.:


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