Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 17 lines (12 sloc) 0.341 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
plan(2);

class Parent {
    has $!bar;

    method bar() { $!bar }
}
class A is Parent {
    has @!foo;

    method foo() { @!foo }
}

my $x := A.bless(foo => [1, 2, 3], bar => 'BARBAR');
ok(pir::join('|', $x.foo) eq '1|2|3', '.new() initializes child class attribute');
ok($x.bar eq 'BARBAR', '.new() initializes parent class attribute');
Something went wrong with that request. Please try again.