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

Rule S4035: Classes implementing "IEquatable<T>" should be sealed #461

Closed
Evangelink opened this issue Jun 21, 2017 · 0 comments
Closed
Assignees
Labels
Type: New Feature This hasn't been here before.
Milestone

Comments

@Evangelink
Copy link
Contributor

Evangelink commented Jun 21, 2017

RSPEC-4035

When a class implements the IEquatable<T> interface, it enters a contract that, in effect, states "I know how to compare two instances of type T or any type derived from T for equality.". However if that class is derived, it is very unlikely that the base class will know how to make a meaningful comparison. Therefore that implicit contract is now broken.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: New Feature This hasn't been here before.
Projects
None yet
Development

No branches or pull requests

2 participants