Skip to content

Commit

Permalink
Only use .container_descriptor if method exists
Browse files Browse the repository at this point in the history
  • Loading branch information
Geoffrey Broadwell committed Nov 26, 2013
1 parent 49c7d75 commit 49074a5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Metamodel/Perlable.pm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ role Metamodel::PerlableAttribute {
}

method perl(Metamodel::PerlableAttribute:D:) {
my $of = self.container_descriptor.of;
my $has_cd = nqp::can(self, 'container_descriptor');
my $of = $has_cd ?? self.container_descriptor.of !! self.type;
my $type = $of.HOW.name($of);
my $name = self.name;
$name .= subst('!', '.') if self.has_accessor;
Expand Down

0 comments on commit 49074a5

Please sign in to comment.