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
Calling hasNext on concatenated iterator can drop elements #8428
Comments
Imported From: https://issues.scala-lang.org/browse/SI-8428?orig=1
|
@adriaanm said (edited on Mar 20, 2014 3:31:30 PM UTC): |
Nick Vrvilo (daowen) said (edited on Mar 20, 2014 4:24:28 PM UTC): |
@Ichoran said: |
@retronym said (edited on Mar 20, 2014 9:02:45 PM UTC): |
@Ichoran said: |
@retronym said: |
Calling hasNext on a concatenated iterator can cause whole subsequences at the front of the iterator to disappear from the final result. I've verified the bug in 2.11.0-RC1, as well as the latest nightly build (scala-2.11.0-20140303-150720-b59c3f8641). This bug did not exist in 2.10.3.
I suspect the bug was introduced in the JoinIterator (in commit scala/scala@e3ddb2d), but I haven't verified that.
In the attached example, the iterators for 4 single-element lists are concatenated, calling hasNext on the first iterator before each concatenation, and the first two elements are missing in the final iterator result.
The text was updated successfully, but these errors were encountered: