scala / bug

Scala 2 bug reports only. Please, no questions — proper bug reports only.
https://scala-lang.org
230 stars 21 forks source link

View.Patched is private[collections] as the only view in View #12825

Open noresttherein opened 11 months ago

noresttherein commented 11 months ago

This is not a bug, an inconsistent feature and a trivial 'enhancement' proposal.

Reproduction steps

Scala version: 2.13.10

All views in View corresponding to various IterableOps and IterableOnce methods are public, with an exception of Patched. Shouldn't it be public like the rest o them?

Apologies if there is a good reason for things being this way, but I was unable to discern it, and it seems like an oversight.

SethTisue commented 11 months ago

@scala/collections

yzia2000 commented 10 months ago

Seems to be done as part of this commit https://github.com/scala/scala/commit/7dbebff1bf21b899080dadf

som-snytt commented 10 months ago

where "to be done" means it was implemented this way, not that the issue was fixed.

Sadly, I missed out on the collections rewrite, which was at https://github.com/scala/collection-strawman

The readme says to consult this branch https://github.com/scala/collection-strawman/tree/before-deletion

Too bad it's not easier to find history; or is it?

git blame allows navigation to the commit https://github.com/scala/collection-strawman/commit/7dbebff1bf21b899080dadf24bc33cf87408a91c and PR https://github.com/scala/collection-strawman/pull/185 which is some work but amazingly possible.

The change was commented upon (remarkably): https://github.com/scala/collection-strawman/pull/185#pullrequestreview-55480029

I also made this class private because it takes an IterableOnce as parameter.

I see that other view classes take IterableOps of unknown collection type, except that from handles IterableOnce. I'm not sure what that means, but my time box just expired.

Footnote: I used to be blase about whether a remark is in the commit message or the PR, where the choice is to bloat the (distributed) repository or tie archaeology to the (centralized) repository. I think I may mentally switch to a model of preserving all commits, and preserving all relevant conversation in commit messages (that is, exclusive of puns). I have read helpful commit messages with cut/paste convos; that should be semi-automated by code review tool.