为什么通用类型定义的 BaseType 本身在可能的情况下不是通用类型定义?

SFu*_*n28 5 .net c# types type-systems .net-4.6

在下面的示例中,我试图理解为什么BaseType不是泛型类型定义,更一般地说,为什么它不只是等于typeof(List<>)

public class MyList<T> : List<T>
{
}

// this is true by definition
typeof(List<>).IsGenericTypeDefinition

// this is false
// also the BaseType.FullName is null ?!?
// also BaseType.IsConstructedGenericType is true ?!?!?
// as such, BaseType != typeof(List<>)
typeof(MyList<>).BaseType.IsGenericTypeDefinition;
Run Code Online (Sandbox Code Playgroud)

编辑-以下是相关主题的一些有用链接

Type.IsGenericTypeDefinition 和 Type.ContainsGenericParameters 之间的区别

.NET 中的“开放泛型类型”到底是什么?

泛型 - 开放式和封闭式构造类型

检测泛型类型是否开放?

https://learn.microsoft.com/en-us/dotnet/api/system.type.isgenerictype

IsGenericType 和 IsGenericTypeDefinition 之间的区别