Skip to content

Commit

Permalink
Avoid some (weird, hard to nail down) circularity issue in getting me…
Browse files Browse the repository at this point in the history
…thod names (we can't always do .name as NQP methods are Parrot subs, which we need to stringify...)
  • Loading branch information
jnthn committed Aug 8, 2011
1 parent 38be712 commit f2aabfa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
7 changes: 5 additions & 2 deletions src/Perl6/Metamodel/RoleToClassApplier.pm
Expand Up @@ -50,8 +50,11 @@ my class RoleToClassApplier {
# Compose in any methods.
my @methods := $to_compose_meta.methods($to_compose, :local(1));
for @methods {
unless has_method($target, ~$_, 0) {
$target.HOW.add_method($target, ~$_, $_);
my $name;
try { $name := $_.name }
unless $name { $name := ~$_ }
unless has_method($target, $name, 0) {
$target.HOW.add_method($target, $name, $_);
}
}
if pir::can__IPs($to_compose_meta, 'private_method_table') {
Expand Down
9 changes: 7 additions & 2 deletions src/Perl6/Metamodel/RoleToRoleApplier.pm
Expand Up @@ -13,7 +13,9 @@ my class RoleToRoleApplier {
my $role := $_;
my @methods := $_.HOW.methods($_, :local(1));
for @methods {
my $name := ~$_;
my $name;
try { $name := $_.name }
unless $name { $name := ~$_ }
my $meth := $_;
my @meth_list;
my @meth_providers;
Expand Down Expand Up @@ -42,7 +44,10 @@ my class RoleToRoleApplier {
my %target_meth_info;
my @target_meths := $target.HOW.methods($target, :local(1));
for @target_meths {
%target_meth_info{~$_} := $_;
my $name;
try { $name := $_.name }
unless $name { $name := ~$_ }
%target_meth_info{$name} := $_;
}

# Process method list.
Expand Down

0 comments on commit f2aabfa

Please sign in to comment.