# New Ticket Created by Moritz Lenz
# Please include the string: [perl #63900]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=63900 >
Rakudo 087e299898416ca6c3a6e2b2bdc3785d841f0ec6:
./perl6 -e 'class P { submethod BUILD($o) { say self.WHAT; $o.shout } };
class C is P { method shout { say "alive" } }; C.new()'
P
alive
C
alive
The submethod BUILD is called twice here, once for the parent and once
for the
child class. If the child class defines such a submethod itself, each is
only
called once and all is fine:
$./perl6 -e 'class P { submethod BUILD($o) { say self.WHAT; $o.shout }
}; class C is P { submethod BUILD($o) { say "in child" }; method shout {
say "alive" } }; C.new()'
P
alive
in child
--
Moritz Lenz
http://perlgeek.de/ | http://perl-6.de/ | http://sudokugarden.de/