Subject: | [BUG] Slipping an empty iterable into an infinite repetition, causes "Cannot shift from an empty Array" |
From: | "Sam S." <smls75 [...] gmail.com> |
To: | rakudobug [...] perl.org |
Date: | Sun, 22 Jan 2017 18:39:31 +0100 |
➜ say (|() xx *)[0];
Cannot shift from an empty Array
in block <unit> at <unknown file> line 1
Obviously, this golfed-down example is not useful as written. But this
happened as an edge case of some real code I was writing.
By contrast, when the `xx` repetition count is finite is works correctly:
➜ say (|() xx 5)[0];
Nil
And when the thing that is being slipped in is non-empty, it also work
correctly:
➜ say (|1 xx *)[0];
1