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

Wrong return type for method take in Iterator #879

Closed
scabug opened this issue May 10, 2008 · 3 comments
Closed

Wrong return type for method take in Iterator #879

scabug opened this issue May 10, 2008 · 3 comments
Milestone

Comments

@scabug
Copy link

scabug commented May 10, 2008

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

@scabug
Copy link
Author

scabug commented May 10, 2008

Imported From: https://issues.scala-lang.org/browse/SI-879?orig=1
Reporter: @jorgeortiz85

@scabug
Copy link
Author

scabug commented May 13, 2008

@dragos said:
Fixed in r15001

@scabug
Copy link
Author

scabug commented Jan 14, 2009

@odersky said:
Milestone next_bugfix deleted

@scabug scabug closed this as completed May 18, 2011
@scabug scabug added this to the 2.7.2 milestone Apr 6, 2017
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

1 participant