Exactly as the title says.
Is it a restriction placed by the C# compiler or does the CLR fundamentally prohibit it?
Exactly as the title says.
Is it a restriction placed by the C# compiler or does the CLR fundamentally prohibit it?
Both.
The C# language, which is not directly tied to the CLR (i.e. Mono AOT) does not allow multiple inheritance.
The CLR type system, which supports languages other than C#, also does not support multiple inheritance.
The CLR prohibits it. If it was only the compiler, you could use Reflection to overcome it at runtime. Multiple inheritance (other than by interface) is in direct violation of the Type system of the CLR.
There are at least three levels:
.NET library: the type system of the .NET doesn't support it (look at the Type.BaseType
property... It's a Type
, not a Type[]
, so not even future support)
IL Language: I don't know, but probably not, otherwise the Type
type would be different (because the IL language was built together with everything else)
C# compiler: no, because the C# is the prime-choice language of .NET and must show everything (nearly everything) that can be done in .NET without creating too many constructs not emulable through the "plain" .NET . Syntactic sugar like LINQ and object initializers are one thing (easily emulable by other languages), a parallel type system not :-)