Conversation
|
Link to relevant scala3 documentation https://docs.scala-lang.org/scala3/reference/contextual/multiversal-equality.html |
|
Looks like this revealed some test issues but also made me realize that this isn't a backwards compatible change as of now. Let me see if I can make it backwardscompatible. |
|
I tried adding a regression test to make sure that old equality behavior remains where the flag is not enabled, but the chimney test is still failing. I don't have any ideas what might be causing this. Not sure how to proceed... |
|
I think all the errors that this PR detected are actual code errors that we should fix but that went undetected since there was no CanEqual defined. I realized that the documentation mentions why this happens
So me defining a CanEqual removes the use of the default defined one. The PR in this form would be a breaking change (even though I think it is a very useful breaking change, since it detected multiple issues within this repo alone). I haven't worked with hybrid codebases were CanEqual is defined for some cases but the flag is not enabled so I was not aware of this outcome. @kitlangton should I move this into a separate module, something like |
|
Hi @kitlangton. Have you had time to think about this? I would be fine making this into |
At $work we are trying out multiversal equality. One of its bigger drawbacks is the need to specify a lot of
CanEqualgivens. Right now we are defining our ownCanEqualfor neotypes but it requires ugly given imports wherever we need to compare neotypes.This PR adds a handy
CanEqualgiven that makes it so that Neotypes will have an availableCanEqualif the wrapped type has one.