Skip to content
Permalink
Browse files

Add private methods from a role to a class in order of declaration

  • Loading branch information...
niner committed May 1, 2019
1 parent aa1d1ce commit 7b5a99810c9ec0a1776fce2ea68574f36b2e6b76
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/Perl6/Metamodel/RoleToClassApplier.nqp
@@ -128,9 +128,11 @@ my class RoleToClassApplier {
}
compose_method_table(nqp::hllize($to_compose_meta.methods($to_compose, :local(1))));
if nqp::can($to_compose_meta, 'private_method_table') {
for nqp::hllize($to_compose_meta.private_method_table($to_compose)) {
unless has_private_method($target, $_.key) {
$target.HOW.add_private_method($target, $_.key, $_.value);
my @private_methods := nqp::hllize($to_compose_meta.private_methods($to_compose));
for @private_methods -> $method {
my str $name := $method.name;
unless has_private_method($target, $name) {
$target.HOW.add_private_method($target, $name, $method);
}
}
}

0 comments on commit 7b5a998

Please sign in to comment.
You can’t perform that action at this time.