Skip to content

Commit

Permalink
Use target type as default default for coercers
Browse files Browse the repository at this point in the history
This way we don't coerce optional parameters when they're not
provided, avoiding uwanted crashes and warnings.

Fixes RT#130479: https://rt.perl.org/Ticket/Display.html?id=130479
  • Loading branch information
zoffixznet committed Jan 17, 2018
1 parent f8c2b55 commit ae69708
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Perl6/Actions.nqp
Expand Up @@ -8738,7 +8738,8 @@ class Perl6::Actions is HLL::Actions does STDActions {
$var.default(QAST::SVal.new( :value('') ));
}
else {
$var.default(QAST::WVal.new( :value($nomtype) ));
$var.default: QAST::WVal.new: value =>
nqp::ifnull($coerce_to, $nomtype);
}
}
}
Expand Down

0 comments on commit ae69708

Please sign in to comment.