GenericTypeParameterBuilder.GetElementType 方法
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
在所有情况下均引发 NotSupportedException。
public:
override Type ^ GetElementType();
public override Type? GetElementType();
public override Type GetElementType();
override this.GetElementType : unit -> Type
Public Overrides Function GetElementType () As Type
由当前数组类型引用的类型、指针类型,或 ByRef
类型;如果当前类型不是数组类型,那么 null
不是指针类型,且不能通过引用传递。
在所有情况下。
泛型类型参数是类型的占位符。 由于无法提前知道该类型,因此无法知道它是否具有元素类型或该元素类型可能是什么。 任何返回值都会具有误导性,因此该方法会 NotSupportedException引发 。
产品 | 版本 |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0 (package-provided), 2.1 |