Why is a generic type constrained by 'Enum' failing to qualify as a 'struct' in C# 7.3?
问题 If I have a generic interface with a struct constraint like this: public interface IStruct<T> where T : struct { } I can supply an enumeration as my type T like so, because an enum satisfies a struct constraint: public class EnumIsAStruct : IStruct<DateTimeKind> { } C# 7.3 added an Enum constraint. The following code, which was previously illegal, now compiles: public class MCVE<T> : IStruct<T> where T : struct, Enum { } However, to my surprise, the following fails to compile: public class