Skip to content

Add IterableOnce operations to IterableOnceOps #8330

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

Closed

Conversation

julienrf
Copy link
Contributor

Fixes scala/bug#11675

This change is backward compatible, because nothing is removed.
It should also be forward compatible, because IterableOnceOps[A] had
IterableOnce[A] as a self-type on 2.13.0, meaning that code relying on the
newly introduced methods also worked on 2.13.0 because any IterableOnceOps[A]
instance was also effectively an IterableOnce[A].

Fixes scala/bug#11675

This change is backward compatible, because nothing is removed.
It should also be forward compatible, because `IterableOnceOps[A]` had
`IterableOnce[A]` as a self-type on 2.13.0, meaning that code relying on the
newly introduced methods also worked on 2.13.0 because any `IterableOnceOps[A]`
instance was also effectively an `IterableOnce[A]`.
@scala-jenkins scala-jenkins added this to the 2.13.1 milestone Aug 12, 2019
@smarter
Copy link
Member

smarter commented Aug 12, 2019

It should also be forward compatible, because IterableOnceOps[A] had
IterableOnce[A] as a self-type on 2.13.0, meaning that code relying on the
newly introduced methods also worked on 2.13.0 because any IterableOnceOps[A]
instance was also effectively an IterableOnce[A].

Not sure that this is enough for foward compatibility. If with this change you can get the compiler to emit something like:

invokeinterface scala/collection/IterableOnceOps.iterable:()Lscala/collection/Iterable;

Then if this classfile is run with the 2.13.0 library jar, you'll probably get a runtime exception since there's no iterable method on the IterableOnceOps interface.

@diesalbla diesalbla added the library:collections PRs involving changes to the standard collection library label Aug 13, 2019
@julienrf julienrf closed this Aug 19, 2019
@julienrf
Copy link
Contributor Author

I’m closing the PR because it breaks binary compatibility, as explained by @smarter.

@SethTisue SethTisue removed this from the 2.13.1 milestone Aug 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
library:collections PRs involving changes to the standard collection library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to call .iterator on an IterableOnceOps value
5 participants