Skip to content
Permalink
Browse files

Make sure BagHash/MixHash.push-all push proxies as well

Because PositionalBindFailover uses .push-all internally to generate its
cache of values, we need to pass proxies in there to make %bh <<+=>> 3 work

Spotted while writing exhaustive infix metaop tests.
  • Loading branch information...
lizmat committed Nov 23, 2018
1 parent 8e27d5f commit 10693d16f1f9e7638a799de4b0c5e524686a3f61
Showing with 2 additions and 6 deletions.
  1. +1 −3 src/core/BagHash.pm6
  2. +1 −3 src/core/MixHash.pm6
@@ -212,12 +212,10 @@ my class BagHash does Baggy {
)
}

# same as Baggy.values
method push-all($target --> IterationEnd) {
nqp::while( # doesn't sink
$!iter,
$target.push(nqp::getattr(
nqp::iterval(nqp::shift($!iter)),Pair,'$!value'))
$target.push(proxy(nqp::shift($!iter),$!hash))
)
}
}
@@ -193,12 +193,10 @@ my class MixHash does Mixy {
)
}

# same as Baggy.values
method push-all($target --> IterationEnd) {
nqp::while( # doesn't sink
$!iter,
$target.push(nqp::getattr(
nqp::iterval(nqp::shift($!iter)),Pair,'$!value'))
$target.push(proxy(nqp::shift($!iter),$!hash))
)
}
}

0 comments on commit 10693d1

Please sign in to comment.
You can’t perform that action at this time.