Skip to content

Commit

Permalink
Fix my @A = 1, 2, 3; @A>>++; say @A;
Browse files Browse the repository at this point in the history
We need to make unary hyper operators eager. Otherwise code with side effects
(like increment or decrement operators) may never actually execute if the
resulting List is not further processed.

Thanks to moritz++ for golfing this bug!
  • Loading branch information
niner committed Aug 23, 2015
1 parent 212d8f4 commit 93ade89
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/metaops.pm
Expand Up @@ -555,7 +555,7 @@ multi sub deepmap(\op, \obj) {
}
}.new(op, iterable.iterator);

nqp::iscont(obj) ?? List.from-iterator(result).item !! List.from-iterator(result)
nqp::iscont(obj) ?? List.from-iterator(result).eager.item !! List.from-iterator(result).eager
}

multi sub deepmap(\op, Associative \h) {
Expand Down

0 comments on commit 93ade89

Please sign in to comment.