New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect behavior with take
on empty vector iterator
#12479
Comments
@scala/collections ? |
minimized: scala 2.13.7> Vector.empty[Int].reverseIterator.take(1).toList
java.lang.IndexOutOfBoundsException: 0 is out of bounds (empty vector)
at scala.collection.immutable.Vector0$.ioob(Vector.scala:371) |
take
on empty vector iterator
It is empty. res4 is the lie.
|
I remember several years ago that tweaking slice iterators is so tricky. I didn't try to understand what Are they releasing 2.13.8 soon? would be nice to sneak this one in. It's an existing bug in the view, but the regression is that
|
Ah, I hadn't realized this was a 2.13.7 specific regression. Presumably from scala/scala#9258. This does put some pressure on us not to wait as long this time before building 2.13.8. (There was a five and a half month gap after 2.13.6.) I'm not sure how much pressure. |
Yes, that's the one. I was going to joke that it really does fail faster. Just a little iterator humo(u)r. |
yup, I think you're right about the cause Seth. technically not my bug, but my fault it now happens without calling |
@SethTisue there's also a ticket I opened for a CVE that should probably get fixed and be released ASAP, if that's motivation for a quick 2.13.8 |
reproduction steps
using Scala 2.13.7
problem
The second assert failes and shouldn't. Attempting to use
afterTake
will crash with an IndexOutOfBoundException.The text was updated successfully, but these errors were encountered: