-
Notifications
You must be signed in to change notification settings - Fork 14
resolve status of scala/scala#8554 for 2.13.2 #671
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
Comments
@szeiger can I ask you to find some resolution here, perhaps working with @joshlemer ? for 2.13.2, I think it would be acceptable to simply revert the PR and then reconsider it for 2.13.3. but if a better solution can be found in time, great |
ping @szeiger? |
Just to lay out what I have been thinking: It's true that my comment from the original issue suggested that perhaps a solution could involve moving the toString implementation to a StrictOptimized_______Ops trait, but later came around to thinking that that is breaking with the existing precedent that these StrictOptimized_Ops traits have until now only been about optimizing implementation, not about changing semantics. And that going forward with changing the semantics to be that only strict collections which inherit from StrictOptimized_Ops are correctly implemented constitutes a drastic change in the api of the collections. Even though it's unsatisfying that a user-defined infinite Iterable has a broken toString unless they override it, it's always been like this: 2.12: scala> new Iterable[Int] { def iterator = Iterator.continually(1) }.toString
java.lang.OutOfMemoryError: Java heap space So it doesn't seem worth it to me, to break the api to fix it. Perhaps in a future major release, we can consider how to deal with So my recommendation would be to revert the change. |
@eed3si9n opinion? |
I think it depends on the philosophy / spirit of the Collection library. What do all the traits mean? Why do we need them, as opposed to just a bag of concrete datatypes? Scala 2.8 collection when it came out was a shining example of what a Scala library can be, and I think it's one of the best things about Scala. Over time, we did find various warts both in its design and implementation; and one of them I think was the fact that traits were broken by default to accommodate various subclasses like parallel collections, mutable, and views. My impression of Scala 2.13 collection is that it tries to keep all the good parts while fixing the warts from the old collection. Coming back to scala/bug#11785, there's no good answer here because
In general, I think someone creating a custom collection and/or |
I'll revert the PR in a few days (for 2.13.2) if nobody else has anything further they want to say. |
This reverts commit dead51b (pull request scala#8554). See discussion on scala/scala-dev#671
This reverts commit ec36826 (pull request scala/scala#8554). See discussion on scala/scala-dev#671
This reverts commit 129e3a7 (pull request scala/scala#8554). See discussion on scala/scala-dev#671
it's breaking scala-collection-contrib; see scala/scala#8554 for details and discussion
The text was updated successfully, but these errors were encountered: