You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 aSmartEnum
derived type. I quickly realized that this is because it doesn't implement the non-generic version of theIComparable
interface, only the generic one.In this particular case, I can modify my
SmartEnum
-derived type to implementIComparable
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-genericIComparable
interface?Thanks in advance for any consideration of this idea.
The text was updated successfully, but these errors were encountered: