Skip to content

Commit

Permalink
Fix for RT #125964
Browse files Browse the repository at this point in the history
- Any.ASSIGN-POS is not the right candidate to handle this case
- make sure there's a List.ASSIGN-POS that can handle it
- please note that you *CAN* assign to a List element if it is a container!
  • Loading branch information
lizmat committed Dec 3, 2017
1 parent e31a414 commit c9699ab
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/core/List.pm
Expand Up @@ -518,6 +518,12 @@ my class List does Iterable does Positional { # declared in BOOTSTRAP
)
}

method ASSIGN-POS(List:D: Int:D \pos, \what) is raw {
nqp::iscont(self.AT-POS(pos))
?? (nqp::atpos($!reified,nqp::unbox_i(pos)) = what)
!! X::Assignment::RO.new(value => self).throw
}

method BIND-POS(List:D: Int:D \pos, \what) is raw {
nqp::iscont(self.AT-POS(pos))
?? nqp::bindpos($!reified,nqp::unbox_i(pos),what)
Expand Down

0 comments on commit c9699ab

Please sign in to comment.