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

Can/should SmartEnum implement the non-generic IComparable interface? #427

Open
prlcutting opened this issue Aug 28, 2023 · 0 comments
Open

Comments

@prlcutting
Copy link

Hi. We depend on some framework code that does comparison of objects based on the non-generic IComparable interface. I just stumbled across a CS0029 compilation error when trying to use a SmartEnum derived type. I quickly realized that this is because it doesn't implement the non-generic version of the IComparable interface, only the generic one.

In this particular case, I can modify my SmartEnum-derived type to implement IComparable itself, but that may not always be possible, and obviously isn't desirable from a DRY/code maintenance point of view.

Is there a reason that SmartEnum couldn't or shouldn't also implement the non-generic IComparable interface?

Thanks in advance for any consideration of this idea.

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

No branches or pull requests

2 participants