Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix up constant folder, thus fixing compilation of Order enum.
  • Loading branch information
jnthn committed Jul 21, 2012
1 parent 35d8ceb commit aff12ef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/QPerl6/ConstantFolder.pm
Expand Up @@ -6,7 +6,7 @@ class QPerl6::ConstantFolder {
# It's already got a compile time value, just hand it back.
$expr
}
elsif $expr.isa(PAST::Op) && $expr.name && ($expr.pasttype eq '' || $expr.pasttype eq 'call') {
elsif nqp::istype($expr, QAST::Op) && $expr.name && $expr.op eq 'call' {
# Potentially foldable call. Try to get compile time args (which
# my involve recursively folding).
my @args;
Expand Down
5 changes: 4 additions & 1 deletion src/QPerl6/World.pm
Expand Up @@ -1164,7 +1164,10 @@ class QPerl6::World is HLL::World {
# returns a reference to it.
method add_constant_folded_result($r) {
self.add_object($r);
QAST::WVal.new( :value($r) );
my $ast := QAST::WVal.new( :value($r) );
$ast<has_compile_time_value> := 1;
$ast<compile_time_value> := $r;
$ast
}

# Creates a meta-object for a package, adds it to the root objects and
Expand Down

0 comments on commit aff12ef

Please sign in to comment.