Skip to content

Commit

Permalink
Report useless use of $_ in my $x = 1,$_
Browse files Browse the repository at this point in the history
The optimizer was not properly propagating void context to comma's args.
  • Loading branch information
TimToady committed Mar 8, 2017
1 parent 5b6e0fb commit 127338a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Perl6/Optimizer.nqp
Expand Up @@ -1383,7 +1383,7 @@ class Perl6::Optimizer {
if $op.name eq '&infix:<,>' {
if +@($op) {
# keep void setting to distribute sink warnings
try self.visit_children($op);
try self.visit_children($op, :void_default($!void_context));
}
elsif $!void_context {
my $suggest := ($op.okifnil ?? ' (use Nil instead to suppress this warning)' !! '');
Expand Down

0 comments on commit 127338a

Please sign in to comment.