-
Notifications
You must be signed in to change notification settings - Fork 21
stringOf eagerly prints infinite iterable #11785
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
|
Should the default |
Fixes scala/bug#11785 This changes the implementation of `Iterable#toString` to not force the evaluation of its elements. To maintain the backward compatibility for most collections the old implementation is called from Set, Seq, and Map, which happen to override toString anyway to avoid the ambiguity with `Function1#toString`. ### notes I considered pushing this into `StrictOptimizedIterableOps` trait as originally suggested in scala/bug#11785, but adding new methods to the trait would introduce bincompat breakage, so swapping out just the implementation would be safer.
Here's my PR - scala/scala#8554 |
Fixes scala/bug#11785 This changes the implementation of Iterable#toString to not force the evaluation of its elements unless it extends StrictOptimizedIterableOps.
fix was reverted; see discussion on scala/scala-dev#671 |
@NthPortal was that unintentional? @Jasper-M also |
yes it was. this is why you only put the "Fixes X" in the PR, and never in the commit message. |
I'm sorry. I didn't know about this etiquette since I've been working on projects with 1~2 members. |
@eed3si9n no worries. I've made the same mistake myself. honestly, it's less etiquette and more a questionable decision on github's part. the issue is, whenever someone with write permissions for the repo containing the issue pushes a new commit containing a "fixes" clause (to the default branch?) to a repo, github evaluates the "fixes" clause. consequently, any time someone with write permissions to scala/bug pushes the commit for the first time to their fork of scala/scala (as I did when I was updating my long-out-of-date copy of the 2.13.x branch), it re-evaluates the clause. it's actually not normally an issue, unless a bug gets reopened. one possible solution would be if the clause was only evaluated when a PR containing it was closed (configurable maybe, as it's still useful in commits for smaller projects?). relatedly, it's not good to put a valid github reference to an issue or PR in a commit message (e.g. "workaround for scala/bug#XXX"), as any time that commit is rebased or pushed to a fork, the issue gets a message added saying that someone referenced it in a commit. if there are a lot of rebases or forks, it gets really spammy (it's not super spammy there, but you can see the sort of thing I'm talking about in #11872). |
Off-loading to the smart dotty people. |
I had forgotten the research over here; it's like catching an old re-run on tv. A quick thought is maybe Someone was recently wondering what is |
Reopening, as it is the responsibility of scala/scala#10178 (Edit: that is the context, not the fix) |
The linked PR strikes a different balance between naively calling The user story is: "I'm trying stuff out in the REPL, I don't necessarily know what I'm doing, so please try not to blow up or hang." |
Haven't tried dotr yet.
The text was updated successfully, but these errors were encountered: