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

Warn when object.Equals is used for comparing structs #284

Open
SergeyTeplyakov opened this issue May 1, 2024 · 3 comments
Open

Warn when object.Equals is used for comparing structs #284

SergeyTeplyakov opened this issue May 1, 2024 · 3 comments

Comments

@SergeyTeplyakov
Copy link
Owner

It seems that it can't be correct since boxing will create a new instance every time.

@SergeyTeplyakov
Copy link
Owner Author

The behavior is correct, but we'll box the arguments.

@SergeyTeplyakov
Copy link
Owner Author

object.ReferenceEquals for structs is meaningless.

@SergeyTeplyakov
Copy link
Owner Author

But for object.ReferenceEquals there is an existing fxcop rule.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant