Skip to content
Permalink
Browse files

Make sure .^compose deconts before composing

Fixes R#2602
  • Loading branch information...
lizmat committed Jan 11, 2019
1 parent 86557cf commit ab8052dde0c0287d560c9e663a4fe4fe00f1fdca
@@ -22,7 +22,9 @@ role Perl6::Metamodel::AttributeContainer {
}

# Composes all attributes.
method compose_attributes($obj, :$compiler_services) {
method compose_attributes($the-obj, :$compiler_services) {
my $obj := nqp::decont($the-obj);

my %seen_with_accessor;
my %meths := nqp::hllize(self.method_table($obj));
my %orig_meths;
@@ -82,7 +82,9 @@ class Perl6::Metamodel::ClassHOW
return 0;
}

method compose($obj, :$compiler_services) {
method compose($the-obj, :$compiler_services) {
my $obj := nqp::decont($the-obj);

# Instantiate all of the roles we have (need to do this since
# all roles are generic on ::?CLASS) and pass them to the
# composer.
@@ -58,7 +58,9 @@ class Perl6::Metamodel::ConcreteRoleHOW
);
}

method compose($obj) {
method compose($the-obj) {
my $obj := nqp::decont($the-obj);

RoleToRoleApplier.apply($obj, self.roles_to_compose($obj));
for self.roles_to_compose($obj) {
@!role_typecheck_list[+@!role_typecheck_list] := $_;
@@ -98,7 +98,9 @@ class Perl6::Metamodel::EnumHOW
@!enum_value_list
}

method compose($obj, :$compiler_services) {
method compose($the-obj, :$compiler_services) {
my $obj := nqp::decont($the-obj);

# Instantiate all of the roles we have (need to do this since
# all roles are generic on ::?CLASS) and pass them to the
# composer.
@@ -31,7 +31,9 @@ class Perl6::Metamodel::NativeHOW
self.add_stash($obj);
}

method compose($obj, :$compiler_services) {
method compose($the-obj, :$compiler_services) {
my $obj := nqp::decont($the-obj);

self.compute_mro($obj);
self.publish_method_cache($obj);
self.publish_type_cache($obj);
@@ -32,7 +32,9 @@ class Perl6::Metamodel::NativeRefHOW
self.add_stash($obj);
}

method compose($obj, :$compiler_services) {
method compose($the-obj, :$compiler_services) {
my $obj := nqp::decont($the-obj);

self.compose_repr($obj);
self.compute_mro($obj);
self.publish_method_cache($obj);
@@ -72,7 +72,9 @@ class Perl6::Metamodel::ParametricRoleHOW
$!in_group ?? $!group !! $obj
}

method compose($obj, :$compiler_services) {
method compose($the-obj, :$compiler_services) {
my $obj := nqp::decont($the-obj);

my @rtl;
if $!in_group {
@rtl.push($!group);

0 comments on commit ab8052d

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