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

s.c.i.Queue's enqueue method takes s.c.i.Iterable instead of s.c.Iterable #6981

Closed
scabug opened this issue Jan 16, 2013 · 3 comments
Closed

Comments

@scabug
Copy link

scabug commented Jan 16, 2013

One of the overloads on scala.collection.immutable.Queue's enqueue method takes a scala.collection.immutable.Iterable as argument, which can cause confusion because the Iterable imported through Predef is the scala.collection.Iterable. For example:

scala> import collection.immutable.Queue
import collection.immutable.Queue

scala> val q: Queue[Int] = Queue(1,2,3)
q: scala.collection.immutable.Queue[Int] = Queue(1, 2, 3)

scala> q.enqueue(Iterable(4))
res10: scala.collection.immutable.Queue[Any] = Queue(1, 2, 3, List(4))

scala> q.enqueue(scala.collection.immutable.Iterable(4))
res11: scala.collection.immutable.Queue[Int] = Queue(1, 2, 3, 4)

Since there's no reason to require an immutable iterable, it should be made more generic.

@scabug
Copy link
Author

scabug commented Jan 16, 2013

Imported From: https://issues.scala-lang.org/browse/SI-6981?orig=1
Reporter: @dcsobral
Affected Versions: 2.10.0
Duplicates #6166

@scabug scabug closed this as completed Jan 2, 2015
@scabug
Copy link
Author

scabug commented Jan 2, 2015

@som-snytt said:
This issue has more description, but is also inadvertently mentioned by an unrelated commit message, so closing in favor of the earlier issue.

@scabug
Copy link
Author

scabug commented Feb 9, 2017

@som-snytt said:
I had totally forgotten about the "unrelated commit message" rule!

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

1 participant