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
-
AnyType
Properties
property Name: System.String<u8>
#
The type's name (without its namespace or type arguments): List, Int32, Int32[].
property Namespace: System.String<u8>
#
property FullName: System.String<u8>
#
The namespace, the name and the type arguments: System.Collections.Generic.List<System.Int32>.
property BaseType: System.Type?
#
The base class (null for any, interfaces, values and the types made from others).
A function type (func<…> : R or func*<…> : R).
A nullable value type (T? of a value type).
property GenericTypeArguments: System.Type[]
#
Methods
method ToString() -> System.String<u8>
#
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).
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
#
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 GetFields(wanted: System.Reflection.BindingFlags) -> System.Reflection.FieldInfo[]
#
method GetField(name: System.String<u8>) -> System.Reflection.FieldInfo?
#
The public field named name (null: none).
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?
#
method GetMethods() -> System.Reflection.MethodInfo[]
#
The public methods (instance and static, inherited ones too; overridden ones once).
method GetMethods(wanted: System.Reflection.BindingFlags) -> System.Reflection.MethodInfo[]
#
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>, wanted: System.Reflection.BindingFlags) -> System.Reflection.MethodInfo?
#
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 GetConstructors(wanted: System.Reflection.BindingFlags) -> 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.
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>
#
field space: System.String<u8>
#
field describer: System.Reflection.TypeDescriber
#
Base, arguments, interfaces and element: from the describer, once.
field baseType: System.Type?
#
field arguments: System.Type[]
#
field interfaces: System.Type[]
#
field element: System.Type?
#
field fields: System.Reflection.FieldInfo[]?
#
field properties: System.Reflection.PropertyInfo[]?
#
field methods: System.Reflection.MethodInfo[]?
#
field constructors: System.Reflection.ConstructorInfo[]?
#
field plain: System.Reflection.ConstructorInfo?
#
The public constructor without parameters (Activator), once found.
field arrayType: System.Type?
#
Types made from this one (T[], T*, T?), once each.
field pointerType: System.Type?
#
field nullableType: System.Type?
#
field grids: System.List<System.Type>?
#
static field sync: System.Reflection.Reentrant
#
What makes each type's Type once, even with threads (the slow path of typeof only).
static field made: System.Dictionary<System.String<u8>, System.Type>?
#
Types that are not one of the program's (functions, the unknown): by full name.
What flags says.
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
#
static method Shadowed(found: System.List<System.Reflection.PropertyInfo>, name: System.String<u8>) -> bool
#
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
#
The same method of a class below (its override) was found first.
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[]
#
method PlainConstructor() -> System.Reflection.ConstructorInfo?
#
What Activator.CreateInstance(type) uses: the public constructor without parameters (null: none).
method ZeroValue() -> System.Any
#
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)
#
Called by the compiler's code: a type it describes.
static method Enter() -> void
#
The reflection lock (taken while a type's Type is made).
static method Exit() -> void
#
static method ArrayOf(element: System.Type, rank: i32) -> System.Type
#
T[] (rank 1) or T[,]…
static method PointerOf(target: System.Type) -> System.Type
#
static method NullableOf(inner: System.Type) -> System.Type
#
A nullable value type T?.
static method FuncOf(parameters: System.Type[], result: System.Type, native: bool) -> System.Type
#
A function type: func<…> : R (or func*<…> : R when native).
static method VoidType() -> System.Type
#
void (the result of a function that gives nothing).
static method Unknown() -> System.Type
#
A type the program does not describe.
Inherited members (4)
GetTypemethod from AnyUndescribedmethod from AnyHashmethod from Anydestroymethod from Any
Source
Type as Larva HIR, decompiled from its Larva 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[]
}