Skip to content

Commit

Permalink
Make sure BagHash/MixHash.push-all push proxies as well
Browse files Browse the repository at this point in the history
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 10693d1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/core/BagHash.pm6
Expand Up @@ -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))
)
}
}
Expand Down
4 changes: 1 addition & 3 deletions src/core/MixHash.pm6
Expand Up @@ -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))
)
}
}
Expand Down

0 comments on commit 10693d1

Please sign in to comment.