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

Coercion type applied via role parameter fails to multi-dispatch #3708

Open
p6rt opened this issue Feb 28, 2015 · 4 comments
Open

Coercion type applied via role parameter fails to multi-dispatch #3708

p6rt opened this issue Feb 28, 2015 · 4 comments

Comments

@p6rt
Copy link

p6rt commented Feb 28, 2015

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

Searchable as RT123953$

@p6rt
Copy link
Author

p6rt commented Feb 28, 2015

From @skids

(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.

@p6rt
Copy link
Author

p6rt commented Dec 3, 2017

From @MasterDuke17

On Sat, 28 Feb 2015 07​:45​:31 -0800, bri@​abrij.org wrote​:

(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.​:

@p6rt
Copy link
Author

p6rt commented Dec 3, 2017

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

@usev6
Copy link

usev6 commented Apr 10, 2021

I guess this has been fixed by @vrurg in the context of Raku/problem-solving#227.

$ ./rakudo-m -e 'role g[::T $t] { multi method foo (T $a) { "OHAI".say }; multi method foo($a) { "ONOES".say }; }; g[Int(Str)].new.foo("100")'
OHAI

Tagging testneeded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants