Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…
Cannot retrieve contributors at this time
42 lines (32 sloc) 904 Bytes
use v6;
use Test;
plan 6;
class Dog {
has $.name;
method bark($times) {
"w00f! " x $times;
my $fido = => 'Fido');
is $, 'Fido', 'correct name';
is $fido.bark(3), 'w00f! w00f! w00f! ', 'Can bark';
class Puppy is Dog {
method bark($times) {
"yap! " x $times;
is, 'yap! yap! ', 'a Puppy can bark, too';
class DogWalker {
has $.name;
has Dog $.dog handles (dog_name => 'name');
my $bob = => 'Bob', dog => $fido);
is $, 'Bob', 'dog walker has a name';
#?pugs skip 'no such method'
is $bob.dog_name, 'Fido', 'dog name can be accessed by delegation';
# RT 75180
#?pugs skip 'no such ^methods'
is Dog.^methods(:local).map({.name}).sort.join('|'),
'bark|name', 'can introspect Dog';
Jump to Line
Something went wrong with that request. Please try again.