I\'ve seen a couple similar threads to this question, but none of them really answer the question I want to ask.
For starters, unfortunately I\'m working with existing A
If I understand what you are wanting to do, then yes, there is no way to define an interface that contains as one of it's members a non-specific enum. Your second example is close, but you are limited to constraining the type of T
to a struct
, which would allow any value type. At that point, you just have to rely on the knowledge of the interfaces proper usage to let folks know the expected type of T
should be an enum. You could potentially make it a little clearer by defining T
as TEnum
or TErrorValue
:
public interface IError where T: struct
{
T ErrorCode;
string Description;
}