Skip to content
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

ConcatIterator returns hasNext = false when not empty #9766

Closed
scabug opened this issue Apr 27, 2016 · 5 comments
Closed

ConcatIterator returns hasNext = false when not empty #9766

scabug opened this issue Apr 27, 2016 · 5 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Apr 27, 2016

After calling ++ on empty ConcatIterator it still returns false on hasNext

  var i: Iterator[Int] = Iterator.empty

  def poll() = {
    while (i.hasNext) {
      println(i.next())
    }
    println("No more elements")
  }

  poll()
  println("here we have join iterator")
  i = i ++ Seq(1, 2, 3)
  poll()
  println("here we have concat iterator")
  i = i ++ Seq(4, 5, 6)
  poll()
  println("append to empty concate iterator")
  i = i ++ Seq(7, 8, 9)
  poll()
  println(i.hasNext)
@scabug
Copy link
Author

scabug commented Apr 27, 2016

Imported From: https://issues.scala-lang.org/browse/SI-9766?orig=1
Reporter: Alexey Romanchuk (13h3r)
Affected Versions: 2.11.8

@scabug
Copy link
Author

scabug commented Apr 27, 2016

Alexey Romanchuk (13h3r) said:
Not reproduced in 2.12.0-M4

@scabug
Copy link
Author

scabug commented Apr 27, 2016

@lrytz said (edited on May 17, 2016 10:41:34 AM UTC):
this is actually fixed in 2.12.0-M4 by scala/scala#5033.

@scabug
Copy link
Author

scabug commented Apr 27, 2016

Alexey Romanchuk (13h3r) said:
Is it possible to backport this fix to 2.11 branch?

@scabug scabug closed this as completed May 23, 2016
@scabug
Copy link
Author

scabug commented May 23, 2016

@lrytz said:
scala/scala#5167 for 2.11.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants