From a381202881d4dfd0a112f9e6f9cddc85adefbccf Mon Sep 17 00:00:00 2001 From: Ben Davies Date: Fri, 20 Mar 2020 19:49:06 -0300 Subject: [PATCH] Revert "Revert "Work around existing bug exposed by mixin caching."" This breaks typechecking for some types of mixins, such as `sub () is nodal { }`. This reverts commit 771b95438e4059e50fd1153e4e611e9f000c0569. --- src/Perl6/Metamodel/Mixins.nqp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Perl6/Metamodel/Mixins.nqp b/src/Perl6/Metamodel/Mixins.nqp index 57451c8102d..6863c46d979 100644 --- a/src/Perl6/Metamodel/Mixins.nqp +++ b/src/Perl6/Metamodel/Mixins.nqp @@ -32,7 +32,15 @@ role Perl6::Metamodel::Mixins { @roles[$i] := nqp::decont(@roles[$i]); ++$i; } - my $mixin_type := nqp::parameterizetype($!mixin_cache, @roles); + # XXX Workaround for mixing in to non-composed types; when this takes + # place (a bunch during CORE.setting) the mixin is missing bits. This + # has long been a problem, and needs a real solution (it's related to + # the "augment does not convey additions to subclasses" issue); mixin + # caching just makes the problem very visible. For now, don't cache if + # the current type is not yet composed. + my $mixin_type := self.is_composed($obj) + ?? nqp::parameterizetype($!mixin_cache, @roles) + !! self.generate_mixin($obj, @roles); # Ensure there's a mixin attribute, if we need it. if $need-mixin-attribute {