Allow case objects to derive CanEqual and be compared in match statements.
#25070
felix-hedenstrom
started this conversation in
Feature Requests
Replies: 2 comments
-
|
Note that the original code compiles if there is a |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
so the issue is really that strict equality is not compatible with CanEqual - i.e. perhaps it could be automatically derived for union types, as user might expect that if a part of a union type has a CanEqual then it could be compatible |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I noticed this behavior when I started working with
strictEqualityand had my hopes that it would be addressed duringSIP-67, even if it is not explicitly mentioned I feel like it is a very similar issue. I'm using
CanEqualandstrictEqualityat work in a way very similar to thiswhich fails with
It compiles if I write
but subjectively this is uglier and not how we used to write code before we started working with
strictEquality.Beta Was this translation helpful? Give feedback.
All reactions