Skip to content

Commit

Permalink
Merge pull request #1343 from jstuder-gh/issue_1305
Browse files Browse the repository at this point in the history
Issue 1305: Throw exception on attempted assign to range pos
  • Loading branch information
lizmat committed Dec 27, 2017
2 parents b13a073 + 51e0aa0 commit c10b8fe
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/core/Range.pm
Expand Up @@ -454,6 +454,8 @@ my class Range is Cool does Iterable does Positional {
&& !(!topic.excludes-max && $!excludes-max))
}

method ASSIGN-POS(Range:D: |) { X::Assignment::RO.new(value => self).throw }

multi method AT-POS(Range:D: int \pos) {
$!is-int
?? self.EXISTS-POS(pos)
Expand Down

0 comments on commit c10b8fe

Please sign in to comment.