class · System

Type

public class System.Type : System.Any

A type at run time: typeof(T) and x.GetType() give the same object for the same type (compare with ==).

Kind
class
Namespace
System
Assembly
System.Core
Access
public, final
Source file
Reflection.ant

Inheritance

Base classes
Any Type

Properties

property Name: System.String<u8>
#

read-only

The type's name (without its namespace or type arguments): List, Int32, Int32[].

property Namespace: System.String<u8>
#

read-only

property FullName: System.String<u8>
#

read-only

The namespace, the name and the type arguments: System.Collections.Generic.List<System.Int32>.

property BaseType: System.Type?
#

read-only

The base class (null for any, interfaces, values and the types made from others).

property IsClass: bool
#

read-only

property IsValueType: bool
#

read-only

property IsInterface: bool
#

read-only

property IsEnum: bool
#

read-only

property IsPrimitive: bool
#

read-only

property IsArray: bool
#

read-only

property IsPointer: bool
#

read-only

property IsGenericType: bool
#

read-only

property IsAbstract: bool
#

read-only

property IsSealed: bool
#

read-only

property IsPublic: bool
#

read-only

property IsFunction: bool
#

read-only

A function type (func<…> : R or func*<…> : R).

property IsNullable: bool
#

read-only

A nullable value type (T? of a value type).

property GenericTypeArguments: System.Type[]
#

read-only

Methods

method ToString() -> System.String<u8>
#

override

method GetGenericArguments() -> System.Type[]
#

The type arguments (of a generic type, a nullable, a function type).

method GetElementType() -> System.Type?
#

What an array or a pointer holds (null otherwise).

method GetArrayRank() -> i32
#

An array's dimensions.

method GetInterfaces() -> System.Type[]
#

The interfaces the type implements (its own and its base classes').

method IsFriendOf(other: System.Type) -> bool
#

Whether this type derives from other (a class below it, not the class itself). Whether [FriendOf] on this type names other, or the other way round: each sees the other's friendly members.

static method Names(on: System.Type, friend: System.Type) -> bool
#

static

method IsSubclassOf(other: System.Type) -> bool
#
method IsAssignableFrom(other: System.Type?) -> bool
#

Whether a value of other can be a value of this type: the same type, a class below it, a type that implements it (this an interface), anything for any.

method IsInstanceOfType(value: System.Any?) -> bool
#

Whether value is one of this type.

method GetFields() -> System.Reflection.FieldInfo[]
#

The public fields (instance and static, inherited ones too).

method GetField(name: System.String<u8>) -> System.Reflection.FieldInfo?
#

The public field named name (null: none).

method GetProperties() -> System.Reflection.PropertyInfo[]
#
method GetProperty(name: System.String<u8>) -> System.Reflection.PropertyInfo?
#
method GetMethods() -> System.Reflection.MethodInfo[]
#

The public methods (instance and static, inherited ones too; overridden ones once).

method GetMethod(name: System.String<u8>) -> System.Reflection.MethodInfo?
#

The public method named name (the first, when it has overloads; null: none).

method GetMethod(name: System.String<u8>, types: System.Type[]) -> System.Reflection.MethodInfo?
#

The public method named name that takes types.

method GetConstructors() -> System.Reflection.ConstructorInfo[]
#
method GetConstructor(types: System.Type[]) -> System.Reflection.ConstructorInfo?
#

The public constructor that takes types (null: none).

method GetEnumNames() -> System.String<u8>[]
#

An enum's member names, in declaration order.

method GetEnumValues() -> i64[]
#

An enum's member values (as numbers), in declaration order.

method GetCustomAttributes() -> System.Any[]
#

The custom attributes written on the type.

method GetCustomAttributes(attributeType: System.Type) -> System.Any[]
#

Those of the attribute class attributeType (or a class below it).

method IsDefined(attributeType: System.Type) -> bool
#

Whether an attribute of attributeType is written on the type.

method MakeArrayType() -> System.Type
#

T[].

method MakeArrayType(rank: i32) -> System.Type
#

T[,]… (rank dimensions).

method MakePointerType() -> System.Type
#

T*.

Private and internal members (60)

field name: System.String<u8>
#

private

field space: System.String<u8>
#

private

field flags: i32
#

private

private

field described: bool
#

private

Base, arguments, interfaces and element: from the describer, once.

field baseType: System.Type?
#

private

field arguments: System.Type[]
#

private

field interfaces: System.Type[]
#

private

field element: System.Type?
#

private

field rank: i32
#

private

field fields: System.Reflection.FieldInfo[]?
#

private

field properties: System.Reflection.PropertyInfo[]?
#

private

field methods: System.Reflection.MethodInfo[]?
#

private

field constructors: System.Reflection.ConstructorInfo[]?
#

private

private

The public constructor without parameters (Activator), once found.

field plainLooked: bool
#

private

field arrayType: System.Type?
#

private

Types made from this one (T[], T*, T?), once each.

field pointerType: System.Type?
#

private

field nullableType: System.Type?
#

private

field grids: System.List<System.Type>?
#

private

static field sync: System.Reflection.Reentrant
#

private static

What makes each type's Type once, even with threads (the slow path of typeof only).

private static

Types that are not one of the program's (functions, the unknown): by full name.

static method ClassFlag() -> i32
#

private static

What flags says.

static method ValueFlag() -> i32
#

private static

static method InterfaceFlag() -> i32
#

private static

static method EnumFlag() -> i32
#

private static

static method PrimitiveFlag() -> i32
#

private static

static method ArrayFlag() -> i32
#

private static

static method GenericFlag() -> i32
#

private static

static method AbstractFlag() -> i32
#

private static

static method FinalFlag() -> i32
#

private static

static method PointerFlag() -> i32
#

private static

static method NullableFlag() -> i32
#

private static

static method FunctionFlag() -> i32
#

private static

static method StaticFlag() -> i32
#

private static

static method PublicFlag() -> i32
#

private static

static method BitflagsFlag() -> i32
#

private static

method Has(flag: i32) -> bool
#

private

method Describe() -> void
#

private

static method Made(key: System.String<u8>, name: System.String<u8>, space: System.String<u8>, flags: i32, describer: System.Reflection.TypeDescriber) -> System.Type
#

private static

static method Join(parts: System.Type[]) -> System.String<u8>
#

private static

static method Holds(types: System.List<System.Type>, type: System.Type) -> bool
#

private static

static method Shadowed(found: System.List<System.Reflection.PropertyInfo>, name: System.String<u8>) -> bool
#

private static

A property of a class below with the same name was found first.

static method Overridden(found: System.List<System.Reflection.MethodInfo>, method: System.Reflection.MethodInfo) -> bool
#

private static

The same method of a class below (its override) was found first.

method Matches(wanted: System.Reflection.BindingFlags, isPublic: bool, isStatic: bool) -> bool
#

private

method OwnFields() -> System.Reflection.FieldInfo[]
#

internal

method OwnProperties() -> System.Reflection.PropertyInfo[]
#

internal

method OwnMethods() -> System.Reflection.MethodInfo[]
#

internal

method OwnConstructors() -> System.Reflection.ConstructorInfo[]
#

internal

method PlainConstructor() -> System.Reflection.ConstructorInfo?
#

internal

What Activator.CreateInstance(type) uses: the public constructor without parameters (null: none).

method ZeroValue() -> System.Any
#

internal

A new value of a value type with no constructor: its zero value.

constructor Type(name: System.String<u8>, space: System.String<u8>, flags: i32, describer: System.Reflection.TypeDescriber)
#

internal

Called by the compiler's code: a type it describes.

static method Enter() -> void
#

internal static

The reflection lock (taken while a type's Type is made).

static method Exit() -> void
#

internal static

static method ArrayOf(element: System.Type, rank: i32) -> System.Type
#

internal static

T[] (rank 1) or T[,]…

static method PointerOf(target: System.Type) -> System.Type
#

internal static

static method NullableOf(inner: System.Type) -> System.Type
#

internal static

A nullable value type T?.

static method FuncOf(parameters: System.Type[], result: System.Type, native: bool) -> System.Type
#

internal static

A function type: func<…> : R (or func*<…> : R when native).

static method VoidType() -> System.Type
#

internal static

void (the result of a function that gives nothing).

static method Unknown() -> System.Type
#

internal static

A type the program does not describe.

Inherited members (4)

Source

Type as Larva HIR, decompiled from its Larva HIR.

System.Type.hir
// A type at run time: `typeof(T)` and `x.GetType()` give the same object for the same type (compare with `==`).
public class System.Type : System.Any
{
    field name: System.String<u8>
    field space: System.String<u8>
    field flags: i32
    field describer: System.Reflection.TypeDescriber
    // Base, arguments, interfaces and element: from the describer, once.
    field described: bool
    field baseType: System.Type?
    field arguments: System.Type[]
    field interfaces: System.Type[]
    field element: System.Type?
    field rank: i32
    field fields: System.Reflection.FieldInfo[]?
    field properties: System.Reflection.PropertyInfo[]?
    field methods: System.Reflection.MethodInfo[]?
    field constructors: System.Reflection.ConstructorInfo[]?
    // The public constructor without parameters (Activator), once found.
    field plain: System.Reflection.ConstructorInfo?
    field plainLooked: bool
    // Types made from this one (T[], T*, T?), once each.
    field arrayType: System.Type?
    field pointerType: System.Type?
    field nullableType: System.Type?
    field grids: System.List<System.Type>?
    // What makes each type's Type once, even with threads (the slow path of typeof only).
    static field sync: System.Reflection.Reentrant
    // Types that are not one of the program's (functions, the unknown): by full name.
    static field made: System.Dictionary<System.String<u8>, System.Type>?
    // What `flags` says.
    static method ClassFlag() -> i32
    static method ValueFlag() -> i32
    static method InterfaceFlag() -> i32
    static method EnumFlag() -> i32
    static method PrimitiveFlag() -> i32
    static method ArrayFlag() -> i32
    static method GenericFlag() -> i32
    static method AbstractFlag() -> i32
    static method FinalFlag() -> i32
    static method PointerFlag() -> i32
    static method NullableFlag() -> i32
    static method FunctionFlag() -> i32
    static method StaticFlag() -> i32
    static method PublicFlag() -> i32
    static method BitflagsFlag() -> i32
    method Has(flag: i32) -> bool
    method Describe() -> void
    static method Made(key: System.String<u8>, name: System.String<u8>, space: System.String<u8>, flags: i32, describer: System.Reflection.TypeDescriber) -> System.Type
    static method Join(parts: System.Type[]) -> System.String<u8>
    static method Holds(types: System.List<System.Type>, type: System.Type) -> bool
    // A property of a class below with the same name was found first.
    static method Shadowed(found: System.List<System.Reflection.PropertyInfo>, name: System.String<u8>) -> bool
    // The same method of a class below (its override) was found first.
    static method Overridden(found: System.List<System.Reflection.MethodInfo>, method: System.Reflection.MethodInfo) -> bool
    method Matches(wanted: System.Reflection.BindingFlags, isPublic: bool, isStatic: bool) -> bool
    method OwnFields() -> System.Reflection.FieldInfo[]
    method OwnProperties() -> System.Reflection.PropertyInfo[]
    method OwnMethods() -> System.Reflection.MethodInfo[]
    method OwnConstructors() -> System.Reflection.ConstructorInfo[]
    // What Activator.CreateInstance(type) uses: the public constructor without parameters (null: none).
    method PlainConstructor() -> System.Reflection.ConstructorInfo?
    // A new value of a value type with no constructor: its zero value.
    method ZeroValue() -> System.Any
    // Called by the compiler's code: a type it describes.
    constructor Type(name: System.String<u8>, space: System.String<u8>, flags: i32, describer: System.Reflection.TypeDescriber)
    // The reflection lock (taken while a type's Type is made).
    static method Enter() -> void
    static method Exit() -> void
    // `T[]` (`rank` 1) or `T[,]`…
    static method ArrayOf(element: System.Type, rank: i32) -> System.Type
    static method PointerOf(target: System.Type) -> System.Type
    // A nullable value type `T?`.
    static method NullableOf(inner: System.Type) -> System.Type
    // A function type: `func<…> : R` (or `func*<…> : R` when `native`).
    static method FuncOf(parameters: System.Type[], result: System.Type, native: bool) -> System.Type
    // `void` (the result of a function that gives nothing).
    static method VoidType() -> System.Type
    // A type the program does not describe.
    static method Unknown() -> System.Type
    method ToString() -> System.String<u8>
    // The type arguments (of a generic type, a nullable, a function type).
    method GetGenericArguments() -> System.Type[]
    // What an array or a pointer holds (null otherwise).
    method GetElementType() -> System.Type?
    // An array's dimensions.
    method GetArrayRank() -> i32
    // The interfaces the type implements (its own and its base classes').
    method GetInterfaces() -> System.Type[]
    // Whether this type derives from `other` (a class below it, not the class itself).
    // Whether `[FriendOf]` on this type names `other`, or the other way round: each sees the other's `friendly` members.
    method IsFriendOf(other: System.Type) -> bool
    static method Names(on: System.Type, friend: System.Type) -> bool
    method IsSubclassOf(other: System.Type) -> bool
    // Whether a value of `other` can be a value of this type: the same type, a class below it, a type that
    // implements it (this an interface), anything for `any`.
    method IsAssignableFrom(other: System.Type?) -> bool
    // Whether `value` is one of this type.
    method IsInstanceOfType(value: System.Any?) -> bool
    // The public fields (instance and static, inherited ones too).
    method GetFields() -> System.Reflection.FieldInfo[]
    method GetFields(wanted: System.Reflection.BindingFlags) -> System.Reflection.FieldInfo[]
    // The public field named `name` (null: none).
    method GetField(name: System.String<u8>) -> System.Reflection.FieldInfo?
    method GetField(name: System.String<u8>, wanted: System.Reflection.BindingFlags) -> System.Reflection.FieldInfo?
    method GetProperties() -> System.Reflection.PropertyInfo[]
    method GetProperties(wanted: System.Reflection.BindingFlags) -> System.Reflection.PropertyInfo[]
    method GetProperty(name: System.String<u8>) -> System.Reflection.PropertyInfo?
    method GetProperty(name: System.String<u8>, wanted: System.Reflection.BindingFlags) -> System.Reflection.PropertyInfo?
    // The public methods (instance and static, inherited ones too; overridden ones once).
    method GetMethods() -> System.Reflection.MethodInfo[]
    method GetMethods(wanted: System.Reflection.BindingFlags) -> System.Reflection.MethodInfo[]
    // The public method named `name` (the first, when it has overloads; null: none).
    method GetMethod(name: System.String<u8>) -> System.Reflection.MethodInfo?
    method GetMethod(name: System.String<u8>, wanted: System.Reflection.BindingFlags) -> System.Reflection.MethodInfo?
    // The public method named `name` that takes `types`.
    method GetMethod(name: System.String<u8>, types: System.Type[]) -> System.Reflection.MethodInfo?
    method GetConstructors() -> System.Reflection.ConstructorInfo[]
    method GetConstructors(wanted: System.Reflection.BindingFlags) -> System.Reflection.ConstructorInfo[]
    // The public constructor that takes `types` (null: none).
    method GetConstructor(types: System.Type[]) -> System.Reflection.ConstructorInfo?
    // An enum's member names, in declaration order.
    method GetEnumNames() -> System.String<u8>[]
    // An enum's member values (as numbers), in declaration order.
    method GetEnumValues() -> i64[]
    // The custom attributes written on the type.
    method GetCustomAttributes() -> System.Any[]
    // Those of the attribute class `attributeType` (or a class below it).
    method GetCustomAttributes(attributeType: System.Type) -> System.Any[]
    // Whether an attribute of `attributeType` is written on the type.
    method IsDefined(attributeType: System.Type) -> bool
    // `T[]`.
    method MakeArrayType() -> System.Type
    // `T[,]`… (`rank` dimensions).
    method MakeArrayType(rank: i32) -> System.Type
    // `T*`.
    method MakePointerType() -> System.Type
    // The type's name (without its namespace or type arguments): `List`, `Int32`, `Int32[]`.
    property Name: System.String<u8>
    property Namespace: System.String<u8>
    // The namespace, the name and the type arguments: `System.Collections.Generic.List<System.Int32>`.
    property FullName: System.String<u8>
    // The base class (null for `any`, interfaces, values and the types made from others).
    property BaseType: System.Type?
    property IsClass: bool
    property IsValueType: bool
    property IsInterface: bool
    property IsEnum: bool
    property IsPrimitive: bool
    property IsArray: bool
    property IsPointer: bool
    property IsGenericType: bool
    property IsAbstract: bool
    property IsSealed: bool
    property IsPublic: bool
    // A function type (`func<…> : R` or `func*<…> : R`).
    property IsFunction: bool
    // A nullable value type (`T?` of a value type).
    property IsNullable: bool
    property GenericTypeArguments: System.Type[]
}
Esc