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

Unable to call .iterator on an IterableOnceOps value #11675

Open
julienrf opened this issue Aug 12, 2019 · 0 comments

Comments

@julienrf
Copy link

commented Aug 12, 2019

See this contributors discussion for the motivation.

In summary, using IterableOnceOps would make it possible to write code polymorphic to Iterable or Iterator, but methods defined by IterableOnce (such as iterator) are not available on IterableOnceOps values.

We should add abstract definitions of the methods declared in IterableOnce, to the IterableOnceOps type.

julienrf added a commit to julienrf/scala that referenced this issue Aug 12, 2019

Add IterableOnce operations to IterableOnceOps
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]`.

@szeiger szeiger added this to the 2.14.0-M1 milestone Aug 13, 2019

julienrf added a commit to julienrf/scala that referenced this issue Aug 19, 2019

Add IterableOnce operations to IterableOnceOps
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]`.

julienrf added a commit to julienrf/scala that referenced this issue Aug 19, 2019

Add IterableOnce operations to IterableOnceOps
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]`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.