Skip to content

Commit

Permalink
Invoke method new on nominalized target
Browse files Browse the repository at this point in the history
Provide coercion context via $*COERCION-TYPE dynamic variable.
  • Loading branch information
vrurg committed Nov 15, 2020
1 parent 58576c2 commit 0edb1fc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Perl6/Metamodel/CoercionHOW.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ class Perl6::Metamodel::CoercionHOW
# then this is gonna result in an exception one way or another.
my $exception;
try {
$coerced_value := $method($obj, $value);
my $*COERCION-TYPE := $obj; # Provide context information to the method 'new'
$coerced_value := $method($!nominal_target, $value);
CATCH {
my $exception_obj := nqp::getpayload($!);

Expand Down

0 comments on commit 0edb1fc

Please sign in to comment.