-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Remove implicit universal Equiv instance for Scala 2.13 #7187
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
Conversation
Based on discussion [here](scala#7164). I didn't seem to have to change any tests for this, so either it was untested or I'm missing something.
|
See also #7186 for the deprecation in 2.12. |
NthPortal
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
|
Thanks @xuwei-k. Sorry, but I still don't quite understand how this is failing. Is it depending on |
|
Ah, I think that this gets a little complicated. Currently |
|
Should we add a low-priority implicit method that summons up an |
|
@NthPortal sorry for going silent for a while. I can't think of a better solution than that. I guess that for consistency there should also be one for |
|
I took a stab at adding prioritized implicits for |
|
When I wrote #7187 (comment) I was thinking that this was on #7186 where there is a deprecation message as opposed to removal. I guess that I still don't understand why that test failed (unless it was really depending on universal equality, in which case this build is probably going to fail too). |
|
@ceedubs I don't think you need one for |
|
@NthPortal my thought was that if someone had written their own |
|
To be clear, I don't think we should implicitly summon |
|
@NthPortal adding the instances for Deprecating the universal instance without further action would be a really annoying change, because when people summon an Since we already have As a Cats maintainer, one thing that struck me is that with the way that things are set up in the standard library, an A solution that seems pretty clean to me (and that I've verified should work) is to provide So here's my proposal:
What do you think? cc @adriaanm |
|
I must be missing something here. How does any of this matter as long as |
|
@szeiger The implicit instances for |
You can't do it in 2.12, for bincompat reasons.
I'm fine with either approach; the former seems maybe slightly better to me, as I feel like |
|
@NthPortal sorry for the delay on this. What would be the binary incompatibility in adding a concrete function to a trait in Scala 2.12? I thought that this would be binary compatible. |
|
@szeiger when when scala looks for an implicit |
|
@ceedubs Scala minor releases are both forwards and backwards compatible. Adding a method on a newer minor release would mean that compiling against that release and running against an older minor release will yield a missing method. |
|
@NthPortal oh I see. Thanks for the explanation. Okay, I'll try to get this PR in shape by the end of the weekend. |
This is a replacement for scala#7187 (see discussion there). This does the following things: 1. Deprecate universal Equiv instance. 2. Create an Ordering -> PartialOrdering conversion. 3. Create a PartialOrdering -> Equiv conversion at a higher priority than the universal instance. 4. Add some unit tests that check that implicit resolution is working as expected. @NthPortal suggested the conversions as a simple way to have `Equiv` instances that could be resolved without duplicating a lot of the work that has been done for `Order` instances for basic types.
|
Replaced by #7358 since @NthPortal recommended going with deprecation as opposed to removal. |
This is a replacement for scala#7187 (see discussion there). This does the following things: 1. Deprecate universal Equiv instance. 2. Create an Ordering -> PartialOrdering conversion. 3. Create a PartialOrdering -> Equiv conversion at a higher priority than the universal instance. 4. Add some unit tests that check that implicit resolution is working as expected. @NthPortal suggested the conversions as a simple way to have `Equiv` instances that could be resolved without duplicating a lot of the work that has been done for `Order` instances for basic types.
This is a replacement for scala#7187 (see discussion there). This does the following things: 1. Deprecate universal Equiv instance. 2. Create an Ordering -> PartialOrdering conversion. 3. Create a PartialOrdering -> Equiv conversion at a higher priority than the universal instance. 4. Add some unit tests that check that implicit resolution is working as expected. @NthPortal suggested the conversions as a simple way to have `Equiv` instances that could be resolved without duplicating a lot of the work that has been done for `Order` instances for basic types.
This is a replacement for scala#7187 (see discussion there). This does the following things: 1. Deprecate universal Equiv instance. 2. Create an Ordering -> PartialOrdering conversion. 3. Create a PartialOrdering -> Equiv conversion at a higher priority than the universal instance. 4. Add some unit tests that check that implicit resolution is working as expected. @NthPortal suggested the conversions as a simple way to have `Equiv` instances that could be resolved without duplicating a lot of the work that has been done for `Order` instances for basic types.
Based on discussion here.
I didn't seem to have to change any tests for this, so either it was
untested or I'm missing something.