Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add some missing coercion cases.
  • Loading branch information
jnthn committed Jul 21, 2012
1 parent 653152e commit aa9f9e7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/QAST/Compiler.nqp
Expand Up @@ -798,6 +798,16 @@ class QAST::Compiler is HLL::Compiler {
try $hll := $*HLL;
return QAST::Operations.unbox(self, $hll, nqp::lc($desired), $post);
}
elsif nqp::index('IiNnSs', $result) >= 0 && nqp::index('IiNnSs', $desired) >= 0 {
# Coercion that we have an op for
my $ops := self.post_new('Ops');
my $rtype := nqp::lc($result);
my $reg := $*REGALLOC."fresh_$rtype"();
$ops.push($post);
$ops.push_pirop('set', $reg, $post);
$ops.result($reg);
return $ops;
}
else {
pir::die("Coercion from '$result' to '$desired' NYI");
}
Expand Down

0 comments on commit aa9f9e7

Please sign in to comment.