Skip to content

Commit

Permalink
Fix coercions instantiation returning its HOW
Browse files Browse the repository at this point in the history
  • Loading branch information
vrurg committed Nov 15, 2020
1 parent e890ddf commit 9725c2e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
4 changes: 1 addition & 3 deletions src/Perl6/Metamodel/CoercionHOW.nqp
Expand Up @@ -40,8 +40,6 @@ class Perl6::Metamodel::CoercionHOW
return $coercion_type;
}
self.set_language_version($coercion_type, :force);
my $tt := $coercion_type.HOW.target_type($coercion_type);
my $ct := $coercion_type.HOW.constraint_type($coercion_type);
nqp::settypecheckmode($coercion_type, 2);
$!composed := 1;
$coercion_type
Expand Down Expand Up @@ -86,7 +84,7 @@ class Perl6::Metamodel::CoercionHOW
}

method instantiate_generic($coercion_type, $type_env) {
return self unless self.archetypes.generic;
return $coercion_type unless $!archetypes.generic;
my $ins_target :=
$!target_type.HOW.archetypes.generic
?? $!target_type.HOW.instantiate_generic($!target_type, $type_env)
Expand Down
1 change: 0 additions & 1 deletion src/Perl6/bootstrap.c/BOOTSTRAP.nqp
Expand Up @@ -296,7 +296,6 @@ my class Binder {
# can happen in (::T, T) where we didn't learn about the type until
# during the signature bind).
if $flags +& $SIG_ELEM_TYPE_GENERIC {
nqp::say("Instantiating " ~ $param_type.HOW.name($param_type) ~ " on " ~ $param.gist) if nqp::getenvhash<RAKUDO_DEBUG>;
$param_type := $param_type.HOW.instantiate_generic($param_type, $lexpad);
}

Expand Down

0 comments on commit 9725c2e

Please sign in to comment.