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

Internal error when calling a multi method if any of the multi methods have been provided through parametric roles in Rakudo #2374

Closed
p6rt opened this issue Feb 20, 2011 · 8 comments

Comments

@p6rt
Copy link

p6rt commented Feb 20, 2011

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

Searchable as RT84492$

@p6rt
Copy link
Author

p6rt commented Feb 20, 2011

From @masak

<masak> rakudo​: role R[​::T] { multi method foo(T $t) { say "called
with a {T}!" } }; class A does R[Str] does R[Int] {}; say "alive";
A.new.foo("OH HAI")
<p6eval> rakudo 9ed54c​: OUTPUT«alive␤get_attr_str() not implemented in
class 'Sub'␤ in main program body at line 7467␤»
* masak submits rakudobug
<masak> jnthn​: thanks for the insider information required to concoct
that one :P
<jnthn> That...wasn't the failure mode I expected. :)
<masak> rakudo​: role R[​::T] { multi method foo(T $t) { say "called
with a {T}!" } }; class A does R[Str] { multi method foo(Int $t) { say
"called with an Int!" } }; say "alive"; A.new.foo("OH HAI")
<p6eval> rakudo 9ed54c​: OUTPUT«alive␤called with a Str()!␤»
<masak> rakudo​: role R[​::T] { multi method foo(T $t) { say "called
with a {T}!" } }; class A does R[Str] { multi method foo(Int $t) { say
"called with an Int!" } }; say "alive"; A.new.foo(42)
<p6eval> rakudo 9ed54c​: OUTPUT«alive␤get_attr_str() not implemented in
class 'Sub'␤ in main program body at line 7467␤»
<masak> huh.
<masak> rakudo​: role R[​::T] { multi method foo(T $t) { say "called
with a {T}!" } }; class A does R[Str] does R[Int] {}; say "alive";
A.new.foo(42)
<p6eval> rakudo 9ed54c​: OUTPUT«alive␤called with a Int()!␤»
<masak> so... it only fails on the multi method that was defined first...?
<masak> rakudo​: class A { multi method foo(Int $t) { say "called with
an Int!" }; multi method foo(Str $t) { say "called with a Str!" } };
A.new.foo(42); A.new.foo("OH HAI")
<p6eval> rakudo 9ed54c​: OUTPUT«called with an Int!␤called with a Str!␤»
<masak> ...of course that works.

@p6rt
Copy link
Author

p6rt commented Oct 20, 2011

From @jnthn

On Sun Feb 20 11​:46​:52 2011, masak wrote​:

<masak> rakudo​: role R[​::T] { multi method foo(T $t) { say "called
with a {T}!" } }; class A does R[Str] does R[Int] {}; say "alive";
A.new.foo("OH HAI")
<p6eval> rakudo 9ed54c​: OUTPUT«alive␤get_attr_str() not implemented in
class 'Sub'␤ in main program body at line 7467␤»
* masak submits rakudobug

Fixed in nom (note, updated to use .gist).

role R[​::T] { multi method foo(T $t) { say "called with a {T.gist}!" }
}; class A does R[Str] does R[Int] {}; say "alive"; A.new.foo("OH HAI")
alive
called with a Str()!

Tagging testneeded.

/jnthn

@p6rt
Copy link
Author

p6rt commented Oct 20, 2011

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

@p6rt
Copy link
Author

p6rt commented Jan 31, 2014

From @peschwa

Am Do 20. Okt 2011, 12​:40​:59, jnthn@​jnthn.net schrieb​:

On Sun Feb 20 11​:46​:52 2011, masak wrote​:

<masak> rakudo​: role R[​::T] { multi method foo(T $t) { say "called
with a {T}!" } }; class A does R[Str] does R[Int] {}; say "alive";
A.new.foo("OH HAI")
<p6eval> rakudo 9ed54c​: OUTPUT«alive␤get_attr_str() not implemented in
class 'Sub'␤ in main program body at line 7467␤»
* masak submits rakudobug

Fixed in nom (note, updated to use .gist).

role R[​::T] { multi method foo(T $t) { say "called with a {T.gist}!" }
}; class A does R[Str] does R[Int] {}; say "alive"; A.new.foo("OH HAI")
alive
called with a Str()!

Tagging testneeded.

/jnthn

Added test to roast in commit 84c4742 as per the example above.

@p6rt
Copy link
Author

p6rt commented Feb 20, 2014

From @coke

jnthn++ added passing test, closing ticket
--
Will "Coke" Coleda

1 similar comment
@p6rt
Copy link
Author

p6rt commented Feb 20, 2014

From @coke

jnthn++ added passing test, closing ticket
--
Will "Coke" Coleda

@p6rt p6rt closed this as completed Feb 20, 2014
@p6rt
Copy link
Author

p6rt commented Feb 20, 2014

@coke - Status changed from 'open' to 'resolved'

@p6rt
Copy link
Author

p6rt commented Feb 20, 2014

From @coke

On Thu Feb 20 07​:55​:32 2014, coke wrote​:

jnthn++ added passing test, closing ticket

Whoops, was peschwa++
--
Will "Coke" Coleda

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

1 participant