Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix bug where .^attributes could make multiple entries for an attribu…
…te in the result list.
  • Loading branch information
jnthn committed Aug 3, 2011
1 parent d097bdc commit 057f236
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Perl6/Metamodel/AttributeContainer.pm
Expand Up @@ -45,16 +45,16 @@ role Perl6::Metamodel::AttributeContainer {

# Introspect attributes.
method attributes($obj, :$local) {
# Always add local ones.
my @attrs;
for @!attributes {
@attrs.push($_);

if $local {
for @!attributes {
@attrs.push($_);
}
}

# Also may need ones from parents.
unless $local {
for self.parents($obj) {
for $_.HOW.attributes($_) {
else {
for self.mro($obj) {
for $_.HOW.attributes($_, :local(1)) {
@attrs.push($_);
}
}
Expand Down

0 comments on commit 057f236

Please sign in to comment.