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

Allow comparing via overloaded equality operator #272

Closed
nothrow opened this issue May 18, 2019 · 1 comment
Closed

Allow comparing via overloaded equality operator #272

nothrow opened this issue May 18, 2019 · 1 comment
Labels

Comments

@nothrow
Copy link
Contributor

nothrow commented May 18, 2019

Hello,

I have some struct-wrapping-integer acting as ID. I have overloaded equality operators between my object and integer, and implicit casts between my struct as integer.

I've seen in code that for struct, implicit casts are ignored, and there is no overloaded equality operator usage support, even if Expression.Equal works with it (https://docs.microsoft.com/en-us/dotnet/api/system.linq.expressions.expression.equal?view=netframework-4.8).

If the Type property of either left or right represents a user-defined type that overloads the equality operator, the MethodInfo that represents that method is the implementing method.

Would it be possible to implement such a support?

@nothrow
Copy link
Contributor Author

nothrow commented May 18, 2019

I also propose PR with solution.

@StefH StefH added the feature label May 18, 2019
@StefH StefH closed this as completed May 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants