Development · Native API migration preview · Coverage validation in progress Published release →

API Browser

Interface

TypeInfo

sealed interface TypeInfo

Module: System.Introspection
Assembly: System.Runtime.dll
Source file: Descriptors.rvn

Inherits: EquatableTo<TypeInfo>
Closed hierarchy: only the permitted direct subtypes can extend this type.
Permitted direct subtypes: RuntimeTypeInfo, NominalTypeInfo, UnionTypeInfo, IntersectionTypeInfo, TupleTypeInfo, FunctionTypeInfo, GenericParameterTypeInfo

Describes nominal and structural types within the current loaded program.

Remarks

Development descriptors compare represented identity through typed and Object equality; reference identity still distinguishes wrapper allocations. TypeInfo no longer inherits MemberInfo. Member queries remain common: structural types may have members and extension members without a declared type name. Use DisplayName for general diagnostics and test for NominalTypeInfo before reading declaration metadata.

Derived interfaces

Documented types in this API reference. Indirect relationships are marked.

Show 1 moreShow less

Properties

24 items
BaseType: Optional<TypeInfo> Gets the declared base type, or None when there is no base type. Defined by TypeInfo.BaseType · Required implementation (no default).
ContainsGenericParameters: bool Recursively tests unbound parameters, including element and structural types. Defined by TypeInfo.ContainsGenericParameters · Required implementation (no default).
DisplayName: string Gets diagnostic text describing the represented type or structural shape. Defined by TypeInfo.DisplayName · Required implementation (no default).
GenericArgumentCount: int Gets the number of generic arguments. Defined by TypeInfo.GenericArgumentCount · Required implementation (no default).
IsAbstract: bool Tests whether the represented type is abstract. Defined by TypeInfo.IsAbstract · Required implementation (no default).
IsArray: bool Tests whether this describes an array. Defined by TypeInfo.IsArray · Required implementation (no default).
IsBeforeFieldInit: bool Whether initialization uses relaxed first-static-field-access timing. Defined by TypeInfo.IsBeforeFieldInit · Required implementation (no default).
IsByRef: bool Tests whether this describes a managed reference. Defined by TypeInfo.IsByRef · Required implementation (no default).
IsClosedHierarchy: bool Tests whether the represented declaration defines a closed family of direct derived types or implementations. Defined by TypeInfo.IsClosedHierarchy · Required implementation (no default).
IsConstructedGenericType: bool True for a constructed nominal generic identity, whether open or closed. Defined by TypeInfo.IsConstructedGenericType · Required implementation (no default).
IsEnum: bool Tests whether this describes an enum. Defined by TypeInfo.IsEnum · Required implementation (no default).
IsFunctionType: bool Gets whether the represented type is a structural Function signature. Defined by TypeInfo.IsFunctionType · Required implementation (no default).
IsGenericParameter: bool True when this identity is an unbound generic parameter. Defined by TypeInfo.IsGenericParameter · Required implementation (no default).
IsGenericType: bool True for a nominal generic definition or constructed nominal generic type. Defined by TypeInfo.IsGenericType · Required implementation (no default).
IsGenericTypeDefinition: bool True when this identity is the declaration with its own unbound parameters. Defined by TypeInfo.IsGenericTypeDefinition · Required implementation (no default).
IsInterface: bool Tests whether this describes an interface. Defined by TypeInfo.IsInterface · Required implementation (no default).
IsNominalType: bool Tests whether this descriptor implements NominalTypeInfo and represents a nominal declaration or its construction. Defined by TypeInfo.IsNominalType · Required implementation (no default).
IsOpen: bool Tests whether the represented class or interface permits unrestricted inheritance or implementation. Defined by TypeInfo.IsOpen · Required implementation (no default).
IsPointer: bool Tests whether this describes an unmanaged pointer. Defined by TypeInfo.IsPointer · Required implementation (no default).
IsReadOnly: bool Tests whether the represented reference is read-only. Defined by TypeInfo.IsReadOnly · Required implementation (no default).
IsUnion: bool Tests whether the represented type has structural union identity. Defined by TypeInfo.IsUnion · Required implementation (no default).
IsValueType: bool Tests whether the represented type has value semantics. Defined by TypeInfo.IsValueType · Required implementation (no default).
IsVisible: bool Whether this type is publicly visible outside its defining assembly. Defined by TypeInfo.IsVisible · Required implementation (no default).
TypeInitializer: Optional<ConstructorInfo> Describes the runtime-owned initializer without executing it. Defined by TypeInfo.TypeInitializer · Required implementation (no default).

Methods

26 items
AssignableFrom(source: TypeInfo) -> bool Returns whether source can be assigned to a variable of this type. Defined by TypeInfo.AssignableFrom · Required implementation (no default).
AssignableTo(target: TypeInfo) -> bool Returns whether this type can be assigned to a variable of target's type. Defined by TypeInfo.AssignableTo · Required implementation (no default).
Extension member: CreateInstance(arguments: ...object?[]) -> Result<object, ReflectionError> Creates the described type using a matching public constructor. Extension from TypeReflectionExtensions.CreateInstance
Extension member: CreateInstance() -> Result<object, ReflectionError> Invokes the public parameterless constructor of a concrete nongeneric reference class. Extension from TypeReflectionExtensions.CreateInstance
Extension member: CreateInstance<T>(arguments: ...object?[]) -> Result<T, ReflectionError> Creates the described type and returns a compatible T view. Extension from TypeReflectionExtensions.CreateInstance
Equals(other: TypeInfo) -> bool Compares represented type identity with another TypeInfo. Defined by TypeInfo.Equals · Required implementation (no default).
GetConstructors() -> Sequence<ConstructorInfo> Gets declared public instance constructor descriptions. Defined by TypeInfo.GetConstructors · Required implementation (no default).
GetConstructors(flags: BindingFlags) -> Sequence<ConstructorInfo> Gets declared constructors matching explicit visibility and instance/static flags. Defined by TypeInfo.GetConstructors · Required implementation (no default).
GetElementType() -> Optional<TypeInfo> Gets the element of an array, pointer or reference shape. Defined by TypeInfo.GetElementType · Required implementation (no default).
GetEnumNames() -> Sequence<string> Gets names declared by the represented enum. Defined by TypeInfo.GetEnumNames · Required implementation (no default).
GetEnumUnderlyingType() -> TypeInfo Gets the underlying integer type of an enum. Defined by TypeInfo.GetEnumUnderlyingType · Required implementation (no default).
GetEnumValues() -> Sequence<object> Gets declared enum values in unsigned underlying-value order. Defined by TypeInfo.GetEnumValues · Required implementation (no default).
GetFields() -> Sequence<FieldInfo> Gets public instance and static fields. Defined by TypeInfo.GetFields · Required implementation (no default).
GetFields(flags: BindingFlags) -> Sequence<FieldInfo> Gets fields selected by binding flags. Defined by TypeInfo.GetFields · Required implementation (no default).
GetGenericArgument(index: int) -> TypeInfo Gets a generic argument by index. Defined by TypeInfo.GetGenericArgument · Required implementation (no default).
GetGenericArguments() -> Sequence<TypeInfo> Gets the represented generic arguments. Defined by TypeInfo.GetGenericArguments · Required implementation (no default).
GetGenericTypeDefinition() -> TypeInfo Returns the source declaration for this nominal generic type; faults for nongeneric types. Defined by TypeInfo.GetGenericTypeDefinition · Required implementation (no default).
GetInterfaces() -> Sequence<TypeInfo> Gets the implemented interface descriptors. Defined by TypeInfo.GetInterfaces · Required implementation (no default).
GetMethods() -> Sequence<MethodInfo> Describes declared methods, including generic definitions and open owner signatures. Defined by TypeInfo.GetMethods · Required implementation (no default).
GetMethods(flags: BindingFlags) -> Sequence<MethodInfo> Gets methods selected by binding flags. Defined by TypeInfo.GetMethods · Required implementation (no default).
GetProperties() -> Sequence<PropertyInfo> Gets public instance and static properties. Defined by TypeInfo.GetProperties · Required implementation (no default).
GetProperties(flags: BindingFlags) -> Sequence<PropertyInfo> Gets properties selected by binding flags. Defined by TypeInfo.GetProperties · Required implementation (no default).
IsInstanceOfType(value: object?) -> bool Returns whether a non-null value can be assigned to a variable of this type. Defined by TypeInfo.IsInstanceOfType · Required implementation (no default).
IsSubclassOf(target: TypeInfo) -> bool Returns whether this type strictly derives from target; interfaces are excluded. Defined by TypeInfo.IsSubclassOf · Required implementation (no default).
MakeArrayType() -> TypeInfo Returns the zero-based vector type with this element type, without allocating an array. Invalid elements and unavailable native array shapes cause a runtime fault. Defined by TypeInfo.MakeArrayType · Required implementation (no default).
MakeGenericType(arguments: Sequence<TypeInfo>) -> Result<TypeInfo, GenericTypeError> Constructs a closed nominal identity; native execution requires its retention. Defined by TypeInfo.MakeGenericType · Required implementation (no default).