Skip to content

Instantly share code, notes, and snippets.

@zoffixznet
Created January 3, 2018 02:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zoffixznet/5ab4bf5bcafbcdf11193387a44b6de8d to your computer and use it in GitHub Desktop.
Save zoffixznet/5ab4bf5bcafbcdf11193387a44b6de8d to your computer and use it in GitHub Desktop.
diff --git a/src/Perl6/Metamodel/BOOTSTRAP.nqp b/src/Perl6/Metamodel/BOOTSTRAP.nqp
index bcfdde762..55fcf52f1 100644
--- a/src/Perl6/Metamodel/BOOTSTRAP.nqp
+++ b/src/Perl6/Metamodel/BOOTSTRAP.nqp
@@ -1598,7 +1598,10 @@ BEGIN {
}));
Parameter.HOW.add_method(Parameter, 'set_coercion', nqp::getstaticcode(sub ($self, $type) {
my $dcself := nqp::decont($self);
- nqp::bindattr_s($dcself, Parameter, '$!coerce_method', $type.HOW.name($type));
+ nqp::bindattr_s($dcself, Parameter, '$!coerce_method',
+ nqp::istype($type.HOW, Metamodel::DefiniteHOW)
+ ?? $type.HOW.base_type($type).HOW.name($type.HOW.base_type: $type)
+ !! $type.HOW.name($type));
nqp::bindattr($dcself, Parameter, '$!coerce_type', nqp::decont($type));
$dcself
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment