C# – Why a Struct can not be derived from another struct

\clrcnetvalue-type

I am more interested in an answer from the .Net and CLR point of view:

Why a struct can not be a base class of another struct or vise versa?

Best Answer

Structs occupy fixed-size slots in the stack (or wherever they're living).

Therefore, you wouldn't be able to do any kind of polymorphism with structs, since the derived struct would be a different size.

It would be possible to inherit members from other structs, but since you wouldn't be able to do any kind of polymprphism, it wouldn't be worth the confusion.