Skip to content

Commit

Permalink
Merge pull request #4052 from vrurg/rakudo_2427
Browse files Browse the repository at this point in the history
Support nested coercions.
  • Loading branch information
vrurg committed Nov 20, 2020
2 parents 32230aa + 2fb0f9f commit 6542f10
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Perl6/Metamodel/CoercionHOW.nqp
Expand Up @@ -137,6 +137,13 @@ class Perl6::Metamodel::CoercionHOW
return $value
}

# Support nested coercions
if nqp::can($!constraint_type.HOW.archetypes, 'coercive')
&& $!constraint_type.HOW.archetypes.coercive
{
$value := $!constraint_type.HOW.coerce($!constraint_type, $value);
}

my $hint;
my $coerced_value := nqp::null();
my $value_type := nqp::what($value);
Expand Down

0 comments on commit 6542f10

Please sign in to comment.