# New Ticket Created by  "Carl Mäsak" 
# Please include the string:  [perl #84492]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=84492 >


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

Reply via email to