Skip to content

Commit

Permalink
Warn on xor with sunk args due to bad precedence
Browse files Browse the repository at this point in the history
Phixes #1389
  • Loading branch information
zoffixznet committed Jan 12, 2018
1 parent 90495b1 commit 79600d6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Perl6/Actions.nqp
Expand Up @@ -329,6 +329,15 @@ sub unwanted($ast, $by) {
elsif $ast.op eq 'bind' {
$ast.sunk(1);
}
elsif $ast.op eq 'xor' {
my int $i := 1;
my int $elems := nqp::elems($ast);
while $i <= $e {
$ast[$i] := UNWANTED($ast[$i], $byby);
++$i;
}
$ast.sunk: 1;
}
}
elsif nqp::istype($ast,QAST::Want) {
$ast.sunk(1);
Expand Down

0 comments on commit 79600d6

Please sign in to comment.