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

Useless type parameter for IterableLike.sliding #4778

Closed
scabug opened this issue Jul 7, 2011 · 2 comments
Closed

Useless type parameter for IterableLike.sliding #4778

scabug opened this issue Jul 7, 2011 · 2 comments
Assignees

Comments

@scabug
Copy link

scabug commented Jul 7, 2011

Why is IterableLike.sliding defined with a type parameter B? It is never used:

def sliding[B >: A](size: Int, step: Int): Iterator[Repr] =
for (xs <- iterator.sliding(size, step)) yield {
val b = newBuilder
b ++= xs
b.result
}

@scabug
Copy link
Author

scabug commented Jul 7, 2011

Imported From: https://issues.scala-lang.org/browse/SI-4778?orig=1
Reporter: @hseeberger
Affected Versions: 2.9.0

@scabug
Copy link
Author

scabug commented Sep 4, 2011

@paulp said:
Yeah, if you guys are wondering where the type parameter came from, know that sliding originated in Iterator and you can't remove the type parameter from that one because of how it's used over there.

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

No branches or pull requests

2 participants