Interface IType
Type descriptor interface.
public interface IType
- Extension Methods
Properties
ArrayElementType
Type of array element for array type.
IType? ArrayElementType { get; }
Property Value
ArraySizes
Optional array sizes for array type. Use array as property type to support multi-dimensional arrays.
IReadOnlyList<int?>? ArraySizes { get; }
Property Value
External
Returns true
if type defined in external code and false
, when type defined in current AST (as class).
bool External { get; }
Property Value
IsNullable
Type nullability. E.g. NRT annotation status for reference type and Nullable`T wrapper presence for value type.
bool IsNullable { get; }
Property Value
IsValueType
Value or reference type.
bool IsValueType { get; }
Property Value
Kind
Type kind.
TypeKind Kind { get; }
Property Value
Name
Type name.
CodeIdentifier? Name { get; }
Property Value
Namespace
Type namespace.
IReadOnlyList<CodeIdentifier>? Namespace { get; }
Property Value
OpenGenericArgCount
Number of type arguments for open generic type.
int? OpenGenericArgCount { get; }
Property Value
- int?
Parent
Parent type for nested types.
IType? Parent { get; }
Property Value
TypeArguments
Type arguments for generic type.
IReadOnlyList<IType>? TypeArguments { get; }
Property Value
Methods
WithNullability(bool)
Apply nullability flag to current type.
IType WithNullability(bool nullable)
Parameters
nullable
boolNew type nullability status.
Returns
- IType
New type instance if nullability changed.
WithTypeArguments(params IType[])
Specify type arguments for open generic type. Method call valid only on open-generic types.
IType WithTypeArguments(params IType[] typeArguments)
Parameters
typeArguments
IType[]Types to use as generic type arguments.
Returns
- IType
Generic type with provided type arguments.