When I trying to define a class which inherits from System.ValueType
or System.Enum
class, I\'m getting an error:
Cannot derive fro
Microsoft does not publish its C# compiler source code, so we can only guess the check is embedded at compiler level.
Mono's C# compiler performs this kind of check at compile time, which you can see around line 2790 in Class.ResolveBaseTypes
method,
https://github.com/mono/mono/blob/master/mcs/mcs/class.cs