Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
sparse array should not act empty on shift
  • Loading branch information
TimToady committed Nov 21, 2015
1 parent 95558bb commit 888ef1b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/Array.pm
Expand Up @@ -591,7 +591,9 @@ my class Array { # declared in BOOTSTRAP
my $reified := nqp::getattr(self, List, '$!reified');
nqp::existspos($reified, 0) || $todo.DEFINITE && $todo.reify-at-least(1)
?? nqp::shift($reified)
!! fail X::Cannot::Empty.new(:action<shift>, :what(self.^name));
!! nqp::elems($reified)
?? Nil
!! fail X::Cannot::Empty.new(:action<shift>, :what(self.^name));
}

proto method splice(|) is nodal { * }
Expand Down

0 comments on commit 888ef1b

Please sign in to comment.