Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
turn WVal into Want + IVal if it's an Int.
  • Loading branch information
timo committed Apr 14, 2013
1 parent 5122e2e commit 6e39296
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Perl6/Optimizer.pm
Expand Up @@ -396,6 +396,13 @@ class Perl6::Optimizer {
if $op.named {
$wval.named($op.named);
}
# if it's an Int, we can create a Want from it witth an int value.
try {
if nqp::istype($ret_value, self.find_in_setting("Int")) && !nqp::isbig_I($ret_value) {
return QAST::Want.new($wval,
"Ii", QAST::IVal.new(:value(nqp::unbox_i($ret_value))));
}
}
return $wval;
}
}
Expand Down

0 comments on commit 6e39296

Please sign in to comment.