Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Don't emit bindassert when constraint is Mu.
  • Loading branch information
jnthn committed Nov 23, 2013
1 parent 3afeb7f commit 3ca2699
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/Perl6/Actions.nqp
Expand Up @@ -1957,11 +1957,13 @@ class Perl6::Actions is HLL::Actions does STDActions {
make QAST::Op.new(
:op<bind>,
QAST::Var.new(:$name, :scope<lexical>),
QAST::Op.new(
:op('p6bindassert'),
$<term_init>.ast,
QAST::WVal.new( :value($type) ),
)
$type =:= $*W.find_symbol(['Mu'])
?? $<term_init>.ast
!! QAST::Op.new(
:op('p6bindassert'),
$<term_init>.ast,
QAST::WVal.new( :value($type) ),
)
);
}
else {
Expand Down Expand Up @@ -4700,9 +4702,11 @@ class Perl6::Actions is HLL::Actions does STDActions {
my int $was_lexical := 0;
try {
my $type := $*W.find_lexical_container_type($target.name);
$source := QAST::Op.new(
:op('p6bindassert'),
$source, QAST::WVal.new( :value($type) ));
unless $type =:= $*W.find_symbol(['Mu']) {
$source := QAST::Op.new(
:op('p6bindassert'),
$source, QAST::WVal.new( :value($type) ));
}
$was_lexical := 1;
}
unless $was_lexical {
Expand Down

0 comments on commit 3ca2699

Please sign in to comment.