Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Don't die optimizing a type object as return value
  • Loading branch information
lizmat committed Jul 24, 2015
1 parent 5d1ec3c commit af22999
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Perl6/Optimizer.nqp
Expand Up @@ -1257,7 +1257,9 @@ class Perl6::Optimizer {
# if it's an Int, Num or Str, we can create a Want
# from it with an int, num or str value.
my $want;
if nqp::istype($ret_value, $!symbols.find_in_setting("Int")) && !nqp::isbig_I(nqp::decont($ret_value)) {
if !nqp::isconcrete($ret_value) {
# can we create a Want with a type object??? XXX
} elsif nqp::istype($ret_value, $!symbols.find_in_setting("Int")) && !nqp::isbig_I(nqp::decont($ret_value)) {
$want := QAST::Want.new($wval,
"Ii", QAST::IVal.new(:value(nqp::unbox_i($ret_value))));
} elsif nqp::istype($ret_value, $!symbols.find_in_setting("Num")) {
Expand Down

0 comments on commit af22999

Please sign in to comment.