Skip to content
Permalink
Browse files

Expose newmixintype via Metamodel::Primitives

Recently, types that were the target of a rebless operation started
needing to be created explicitly as mixin target types, to assist
optimization. Expose the ability to do this in Metamodel::Primitives
by allowing a `:mixin` flag to be passed to `create_type`.
  • Loading branch information...
jnthn committed Apr 18, 2019
1 parent e11d0d5 commit 4702c245f083415aceac5d67d60fb86ace558b9c
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/core/Metamodel/Primitives.pm6
@@ -1,6 +1,8 @@
my class Metamodel::Primitives {
method create_type(Mu $how, $repr = 'P6opaque') {
nqp::newtype($how, $repr.Str)
method create_type(Mu $how, $repr = 'P6opaque', :$mixin = False) {
$mixin
?? nqp::newmixintype($how, $repr.Str)
!! nqp::newtype($how, $repr.Str)
}

method set_package(Mu $type, $package) {

0 comments on commit 4702c24

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