Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Implement :tree in .^parents.
  • Loading branch information
jnthn committed Jul 9, 2011
1 parent bab5ed2 commit 98baf0f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/Perl6/Metamodel/MultipleInheritance.pm
Expand Up @@ -21,10 +21,19 @@ role Perl6::Metamodel::MultipleInheritance {
}

# Introspects the parents.
method parents($obj, :$local) {
method parents($obj, :$local, :$tree) {
if $local {
@!parents
}
elsif $tree {
my @result;
for @!parents {
my @pt := [$_];
@pt.push($_.HOW.parents($_, :tree(1)));
@result.push(pir::perl6ize_type__PP(@pt).Array.item);
}
return pir::perl6ize_type__PP(@result);
}
else {
# All parents is MRO minus the first thing (which is us).
my @mro := self.mro($obj);
Expand Down

0 comments on commit 98baf0f

Please sign in to comment.