-
Notifications
You must be signed in to change notification settings - Fork 87
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
IterableOnce.iterator not available in Scala 2.12.x #493
Comments
|
I may have misspoke. I don't believe the import as stated works. In order to get the implicit conversions that power this library, you would need a wildcard import. import scala.collection.compat._ Having such an import makes the Moreover I believe the functionality already exists here https://github.com/scala/scala-collection-compat/blob/main/compat/src/main/scala-2.11_2.12/scala/collection/compat/PackageShared.scala#L416 Voting to close this one as not an issue. |
@borice not sure if you're still around, but do you agree...? |
|
Scala 2.12:
migrating the above contrived example to Scala 2.13 (according to the
@deprecated
instructions) leads to:Scala 2.13:
Trying to cross-compile the Scala 2.13 version to 2.12 using
scala-collection-compat
, we get a compilation error complaining about.iterator
not being a member of TraversableOnce[Int]. Indeed,.iterator
is only available onIterableOnce
, but not inTraversableOnce
. However,TraversableOnce
does have a.toIterator
method (but it's deprecated inIterableOnce
).Adding a
.iterator
extension method to TraversableOnce inscala-collection-compat
for Scala 2.12- that calls.toIterator
would solve the problem.The text was updated successfully, but these errors were encountered: