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

Replace buildFromAny with buildFromNothing #4815

Merged
merged 2 commits into from Mar 18, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion core/shared/src/main/scala-2.13+/zio/BuildFromCompat.scala
Expand Up @@ -6,7 +6,12 @@ private[zio] trait BuildFromCompat {

type BuildFrom[-From, -A, +C] = scala.collection.BuildFrom[From, A, C]

implicit def buildFromAny[Element, Collection[+Element] <: Iterable[Element] with IterableOps[Any, Collection, Any]]
@deprecated("Use BuildFrom.buildFromIterableOps or buildFromNothing instead", "1.0.6")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're going to change this can we just delete it entirely instead of deprecating it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't that be binary incompatible?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Binary compatibility checks seem to be okay.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or was that on purpose?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adamgfraser oh I see why - we check binary compatibility against 1.0.1 but this was added in 1.0.4-1: https://github.com/zio/zio/releases/tag/v1.0.4-1

Wow, I never really thought about this, but if you don't bump the version for MiMa that means you could accidentally delete something that you introduced in a later version. Amazing 🤯

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I bump the version in MimaSettings?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes we should.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes me think there should be some process or automation to bump this version on release

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Not sure what the best way is to do it but that would definitely be good.

def buildFromAny[Element, Collection[+Element] <: Iterable[Element] with IterableOps[Any, Collection, Any]]
: BuildFrom[Collection[Any], Element, Collection[Element]] =
scala.collection.BuildFrom.buildFromIterableOps[Collection, Any, Element]

implicit def buildFromNothing[A, Collection[+Element] <: Iterable[Element] with IterableOps[A, Collection, _]]
: BuildFrom[Collection[A], Nothing, Collection[Nothing]] =
scala.collection.BuildFrom.buildFromIterableOps[Collection, A, Nothing]
}