Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fail when trying to reverse an infinite list
  • Loading branch information
Tadeusz Sośnierz committed Mar 5, 2011
1 parent d85450a commit bfdd78d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/List.pm
Expand Up @@ -45,7 +45,9 @@ augment class List does Positional {
}
method reverse() {
# XXX: fail if infinite
if self.elems ~~ Inf {
fail "Cannot reverse an infinite list"
}
Q:PIR {
.local pmc self, items, parcel
self = find_lex 'self'
Expand Down

0 comments on commit bfdd78d

Please sign in to comment.