Skip to content

Commit

Permalink
Make Metamodel::EnumHOW consumer of ::Composing
Browse files Browse the repository at this point in the history
Also relax sigature on default .compose, as it's not being checked
anyway, so just blindly eat any nameds by default
  • Loading branch information
lizmat committed Feb 25, 2024
1 parent 2e4113c commit 6987704
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/Perl6/Metamodel/Composing.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ role Perl6::Metamodel::Composing {
has int $!composed;

# Null operation, if the consumer doesn't supply a "compose" of its own
method compose($XXX?, :$compiler_services) { $!composed := 1 }
method compose($XXX?, *%_) { $!composed := 1 }

method set_composed($XXX?) { $!composed := 1 }
method is_composed($XXX?) { $!composed }
Expand Down
12 changes: 3 additions & 9 deletions src/Perl6/Metamodel/EnumHOW.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
class Perl6::Metamodel::EnumHOW
does Perl6::Metamodel::Naming
does Perl6::Metamodel::Documenting
does Perl6::Metamodel::Composing
does Perl6::Metamodel::LanguageRevision
does Perl6::Metamodel::Stashing
does Perl6::Metamodel::AttributeContainer
Expand Down Expand Up @@ -37,9 +38,6 @@ class Perl6::Metamodel::EnumHOW
has $!role;
has int $!roled;

# Are we composed yet?
has $!composed;

# Exportation callback for enum symbols, if any.
has $!export_callback;

Expand Down Expand Up @@ -168,9 +166,9 @@ class Perl6::Metamodel::EnumHOW
self.create_BUILDPLAN($obj);

# Compose the representation.
unless $!composed {
unless self.is_composed {
self.compose_repr($obj);
$!composed := 1;
self.set_composed;
}

#?if !moar
Expand Down Expand Up @@ -200,10 +198,6 @@ class Perl6::Metamodel::EnumHOW
$!role
}

method is_composed($obj) {
$!composed
}

method role_typecheck_list($obj) {
@!role_typecheck_list
}
Expand Down

0 comments on commit 6987704

Please sign in to comment.