Skip to content
Permalink
Browse files

Instantiate a role's methods in predictable order

  • Loading branch information...
niner committed May 1, 2019
1 parent 7b5a998 commit a973dae670973ae9fbce51941014c07f8471e660
Showing with 6 additions and 7 deletions.
  1. +6 −7 src/Perl6/Metamodel/ParametricRoleHOW.nqp
@@ -176,14 +176,13 @@ class Perl6::Metamodel::ParametricRoleHOW

# Go through methods and instantiate them; we always do this
# unconditionally, since we need the clone anyway.
for nqp::hllize(self.method_table($obj)) {
$conc.HOW.add_method($conc, $_.key, $_.value.instantiate_generic($type_env))
my @methods := nqp::hllize(self.methods($obj, :local(1)));
for @methods -> $method {
$conc.HOW.add_method($conc, $method.name, $method.instantiate_generic($type_env))
}
for nqp::hllize(self.submethod_table($obj)) {
$conc.HOW.add_method($conc, $_.key, $_.value.instantiate_generic($type_env))
}
for nqp::hllize(self.private_method_table($obj)) {
$conc.HOW.add_private_method($conc, $_.key, $_.value.instantiate_generic($type_env));
my @private_methods := nqp::hllize(self.private_methods($obj));
for @private_methods -> $method {
$conc.HOW.add_private_method($conc, $method.name, $method.instantiate_generic($type_env));
}
for self.multi_methods_to_incorporate($obj) {
$conc.HOW.add_multi_method($conc, $_.name, $_.code.instantiate_generic($type_env))

0 comments on commit a973dae

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