Discussion: reference equality operator #540
-
dotnet/roslyn#8409 suggests to use var equal = e1 is e2; |
Beta Was this translation helpful? Give feedback.
Replies: 10 comments 1 reply
-
I think your var equal = e1 is e2; is a huge improvement on |
Beta Was this translation helpful? Give feedback.
-
So |
Beta Was this translation helpful? Give feedback.
-
As it turns out |
Beta Was this translation helpful? Give feedback.
-
Please reopen? The main benefit I was looking forward to was replacing all my |
Beta Was this translation helpful? Give feedback.
-
Seconding @jnm2: I thought the whole point to this proposal was for better syntax for |
Beta Was this translation helpful? Give feedback.
-
The first issue that arises here is that it silently changes the semantics of |
Beta Was this translation helpful? Give feedback.
-
Won't this conflict with current
|
Beta Was this translation helpful? Give feedback.
-
No binding changes are suggested as part of this proposal. You could already use |
Beta Was this translation helpful? Give feedback.
-
I would disagree that Related to that, there were multiple proposals of allowing the user to reinterpret I'd rather have flexibility over |
Beta Was this translation helpful? Give feedback.
-
@alrz Please reopen dotnet/roslyn#8409? |
Beta Was this translation helpful? Give feedback.
I would disagree that
x is y
is beneficiary overReferenceEquals(x, y)
. The latter is explicit, while the former is vague. With all pattern matching going around, one will have to remember whatis
means in this case.Related to that, there were multiple proposals of allowing the user to reinterpret
is
. This proposal conflicts with those.I'd rather have flexibility over
is
reinterpretation, than a hardcoded "reference equality" semantics.