Skip Menu |
Report information
Id: 74646
Status: resolved
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)



Subject: [BUG] Multi submethods inherit (but shouldn't) in Rakudo
Date: Sun, 25 Apr 2010 00:07:34 +0200
To: rakudobug [...] perl.org
From: Carl Mäsak <cmasak [...] gmail.com>
Download (untitled) / with headers
text/plain 557b
<masak> rakudo: class A { multi method foo($a) { "general" }; multi submethod foo(Str $a) { "specific" } }; class B is A {}; say .new.foo("OH HAI") for A, B <p6eval> rakudo 55a62a: OUTPUT«specific␤specific␤» <masak> should be "specific\ngeneral\n". <masak> (since submethods don't inherit) * masak submits rakudobug <masak> rakudo: class A { submethod foo { say "OH HAI" } }; class B is A {}; B.new.foo <p6eval> rakudo 55a62a: OUTPUT«Method 'foo' not found for invocant of class 'B' [...] <masak> works for only methods but not for multi submethods.
Download (untitled) / with headers
text/plain 683b
On Sat Apr 24 15:08:08 2010, masak wrote: Show quoted text
> <masak> rakudo: class A { multi method foo($a) { "general" }; multi > submethod foo(Str $a) { "specific" } }; class B is A {}; say > .new.foo("OH HAI") for A, B > <p6eval> rakudo 55a62a: OUTPUT«specific␤specific␤»
Still happening in rakudo 88c5a5. Show quoted text
> <masak> should be "specific\ngeneral\n". > <masak> (since submethods don't inherit) > * masak submits rakudobug > <masak> rakudo: class A { submethod foo { say "OH HAI" } }; class B is > A {}; B.new.foo > <p6eval> rakudo 55a62a: OUTPUT«Method 'foo' not found for invocant of > class 'B' [...] > <masak> works for only methods but not for multi submethods.
-- Will "Coke" Coleda
Download (untitled) / with headers
text/plain 412b
On Sat Oct 08 13:00:27 2011, coke wrote: Show quoted text
> On Sat Apr 24 15:08:08 2010, masak wrote:
> > <masak> rakudo: class A { multi method foo($a) { "general" }; multi > > submethod foo(Str $a) { "specific" } }; class B is A {}; say > > .new.foo("OH HAI") for A, B > > <p6eval> rakudo 55a62a: OUTPUT«specific␤specific␤»
> > Still happening in rakudo 88c5a5.
Still happening in rakudo 112307b -- Will "Coke" Coleda
Download (untitled) / with headers
text/plain 486b
On Sat Nov 17 14:37:29 2012, coke wrote: Show quoted text
> On Sat Oct 08 13:00:27 2011, coke wrote:
> > On Sat Apr 24 15:08:08 2010, masak wrote:
> > > <masak> rakudo: class A { multi method foo($a) { "general" }; multi > > > submethod foo(Str $a) { "specific" } }; class B is A {}; say > > > .new.foo("OH HAI") for A, B > > > <p6eval> rakudo 55a62a: OUTPUT«specific␤specific␤»
> > > > Still happening in rakudo 88c5a5.
> > Still happening in rakudo 112307b
Still happening in rakudo f9dca91
RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 682b
On Sat Apr 24 15:08:08 2010, masak wrote: Show quoted text
> <masak> rakudo: class A { multi method foo($a) { "general" }; multi > submethod foo(Str $a) { "specific" } }; class B is A {}; say > .new.foo("OH HAI") for A, B > <p6eval> rakudo 55a62a: OUTPUT«specific␤specific␤» > <masak> should be "specific\ngeneral\n". > <masak> (since submethods don't inherit) > * masak submits rakudobug > <masak> rakudo: class A { submethod foo { say "OH HAI" } }; class B is > A {}; B.new.foo > <p6eval> rakudo 55a62a: OUTPUT«Method 'foo' not found for invocant of > class 'B' [...] > <masak> works for only methods but not for multi submethods.
Fixed, and tests in S12-methods/multi.t unfudged. /jnthn


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