Skip to content

Commit

Permalink
(is_)array_type don't need any positional argument
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Feb 27, 2024
1 parent 4f64b48 commit 5585454
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/Perl6/Metamodel/ParametricRoleHOW.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@ class Perl6::Metamodel::ParametricRoleHOW

# Resolve any array type being passed along (only really used in the
# punning case, since roles are the way we get generic types).
if self.is_array_type($target) {
my $at := self.array_type($target);
if self.is_array_type {
my $at := self.array_type;
if $at.HOW.archetypes($at).generic {
$at := $at.HOW.instantiate_generic($at, $type_env);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Perl6/Metamodel/REPRComposeProtocol.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ role Perl6::Metamodel::REPRComposeProtocol {
method compose_repr($target) {
unless $!composed_repr {
# Is it an array type?
if nqp::can(self, 'is_array_type') && self.is_array_type($target) {
if nqp::can(self, 'is_array_type') && self.is_array_type {
if self.attributes($target) {
nqp::die("Cannot have attributes on an array representation");
}
nqp::composetype(nqp::decont($target), nqp::hash('array',
nqp::hash('type', nqp::decont(self.array_type($target)))));
nqp::hash('type', nqp::decont(self.array_type))));
}

# Otherwise, presume it's an attribute type.
Expand Down
6 changes: 3 additions & 3 deletions src/Perl6/Metamodel/RoleToClassApplier.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,10 @@ my class RoleToClassApplier {
}

# Copy any array_type.
if nqp::can($!target.HOW, 'is_array_type') && !$!target.HOW.is_array_type($!target) {
if nqp::can($!target.HOW, 'is_array_type') && !$!target.HOW.is_array_type {
if nqp::can($!to_compose_meta, 'is_array_type') {
if $!to_compose_meta.is_array_type($!to_compose) {
$!target.HOW.set_array_type($!target, $!to_compose_meta.array_type($!to_compose));
if $!to_compose_meta.is_array_type {
$!target.HOW.set_array_type($!target, $!to_compose_meta.array_type);
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/Perl6/Metamodel/RoleToRoleApplier.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,10 @@ my class RoleToRoleApplier {
}
}

if nqp::can($target.HOW, 'is_array_type') && !$target.HOW.is_array_type($target) {
if nqp::can($target.HOW, 'is_array_type') && !$target.HOW.is_array_type {
if nqp::can($how, 'is_array_type') {
if $how.is_array_type($r) {
$target.HOW.set_array_type($target, $how.array_type($r));
if $how.is_array_type {
$target.HOW.set_array_type($target, $how.array_type);
}
}
}
Expand Down

0 comments on commit 5585454

Please sign in to comment.