We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Line 222 in Iterator.scala should be:
def take(n: Int): Iterator[A] = new Iterator[A] {
Otherwise the type returned by take makes it hard to subclass Iterator:
scala> val it: Iterator[Int] = Array(1, 2, 3, 4, 5).elements val it: Iterator[Int] = Array(1, 2, 3, 4, 5).elements it: Iterator[Int] = non-empty iterator
scala> it.take(3) it.take(3) res8: java.lang.Object with Iterator[Int]{def remaining: Int; def remaining_=(Int): Unit} = non-empty iterator
The text was updated successfully, but these errors were encountered:
Imported From: https://issues.scala-lang.org/browse/SI-879?orig=1 Reporter: @jorgeortiz85
Sorry, something went wrong.
@dragos said: Fixed in r15001
@odersky said: Milestone next_bugfix deleted
No branches or pull requests
Line 222 in Iterator.scala should be:
Otherwise the type returned by take makes it hard to subclass Iterator:
scala> val it: Iterator[Int] = Array(1, 2, 3, 4, 5).elements
val it: Iterator[Int] = Array(1, 2, 3, 4, 5).elements
it: Iterator[Int] = non-empty iterator
scala> it.take(3)
it.take(3)
res8: java.lang.Object with Iterator[Int]{def remaining: Int; def remaining_=(Int): Unit} = non-empty iterator
The text was updated successfully, but these errors were encountered: