Table of Contents

Class TupleType

Namespace
ICSharpCode.Decompiler.TypeSystem
Assembly
ICSharpCode.Decompiler.dll
public sealed class TupleType : AbstractType, IType, INamedElement, IEquatable<IType>, ICompilationProvider
Inheritance
TupleType
Implements
Inherited Members
Extension Methods

Constructors

TupleType(ICompilation, ImmutableArray<IType>, ImmutableArray<string>, IModule)

public TupleType(ICompilation compilation, ImmutableArray<IType> elementTypes, ImmutableArray<string> elementNames = default, IModule valueTupleAssembly = null)

Parameters

compilation ICompilation
elementTypes ImmutableArray<IType>
elementNames ImmutableArray<string>
valueTupleAssembly IModule

Fields

RestPosition

public const int RestPosition = 8

Field Value

int

Properties

Cardinality

Gets the cardinality of the tuple.

public int Cardinality { get; }

Property Value

int

Compilation

Gets the parent compilation. This property never returns null.

public ICompilation Compilation { get; }

Property Value

ICompilation

DirectBaseTypes

public override IEnumerable<IType> DirectBaseTypes { get; }

Property Value

IEnumerable<IType>

ElementNames

Gets the names of the tuple elements.

public ImmutableArray<string> ElementNames { get; }

Property Value

ImmutableArray<string>

ElementTypes

Gets the tuple elements.

public ImmutableArray<IType> ElementTypes { get; }

Property Value

ImmutableArray<IType>

FullName

public override string FullName { get; }

Property Value

string

IsReferenceType

public override bool? IsReferenceType { get; }

Property Value

bool?

Kind

Gets the type kind.

public override TypeKind Kind { get; }

Property Value

TypeKind

Name

public override string Name { get; }

Property Value

string

Namespace

Gets the full name of the namespace containing this entity.

public override string Namespace { get; }

Property Value

string

ReflectionName

public override string ReflectionName { get; }

Property Value

string

TypeArguments

Gets the type arguments passed to this type. If this type is a generic type definition that is not parameterized, this property returns the type parameters, as if the type was parameterized with its own type arguments (class C<T> { C<T> field; }).

public override IReadOnlyList<IType> TypeArguments { get; }

Property Value

IReadOnlyList<IType>

TypeParameterCount

Gets the number of type parameters.

public override int TypeParameterCount { get; }

Property Value

int

TypeParameters

Gets the type parameters. Returns an empty list if this type is not generic.

public override IReadOnlyList<ITypeParameter> TypeParameters { get; }

Property Value

IReadOnlyList<ITypeParameter>

UnderlyingType

Gets the underlying System.ValueType type.

public ParameterizedType UnderlyingType { get; }

Property Value

ParameterizedType

Methods

AcceptVisitor(TypeVisitor)

public override IType AcceptVisitor(TypeVisitor visitor)

Parameters

visitor TypeVisitor

Returns

IType

Equals(IType)

public override bool Equals(IType other)

Parameters

other IType

Returns

bool

FromUnderlyingType(ICompilation, IType)

Construct a tuple type (without element names) from the given underlying type. Returns null if the input is not a valid underlying type.

public static TupleType FromUnderlyingType(ICompilation compilation, IType type)

Parameters

compilation ICompilation
type IType

Returns

TupleType

GetAccessors(Predicate<IMethod>, GetMemberOptions)

public override IEnumerable<IMethod> GetAccessors(Predicate<IMethod> filter = null, GetMemberOptions options = GetMemberOptions.None)

Parameters

filter Predicate<IMethod>
options GetMemberOptions

Returns

IEnumerable<IMethod>

GetConstructors(Predicate<IMethod>, GetMemberOptions)

public override IEnumerable<IMethod> GetConstructors(Predicate<IMethod> filter = null, GetMemberOptions options = GetMemberOptions.IgnoreInheritedMembers)

Parameters

filter Predicate<IMethod>
options GetMemberOptions

Returns

IEnumerable<IMethod>

GetDefinition()

Gets the underlying type definition. Can return null for types which do not have a type definition (for example arrays, pointers, type parameters).

public override ITypeDefinition GetDefinition()

Returns

ITypeDefinition

GetDefinitionOrUnknown()

Gets the underlying type definition or UnkownType, if unknown. Can return null for types which do not have a type definition (for example arrays, pointers, type parameters).

public override ITypeDefinitionOrUnknown GetDefinitionOrUnknown()

Returns

ITypeDefinitionOrUnknown

GetEvents(Predicate<IEvent>, GetMemberOptions)

public override IEnumerable<IEvent> GetEvents(Predicate<IEvent> filter = null, GetMemberOptions options = GetMemberOptions.None)

Parameters

filter Predicate<IEvent>
options GetMemberOptions

Returns

IEnumerable<IEvent>

GetFields(Predicate<IField>, GetMemberOptions)

public override IEnumerable<IField> GetFields(Predicate<IField> filter = null, GetMemberOptions options = GetMemberOptions.None)

Parameters

filter Predicate<IField>
options GetMemberOptions

Returns

IEnumerable<IField>

GetHashCode()

public override int GetHashCode()

Returns

int

GetMethods(IReadOnlyList<IType>, Predicate<IMethod>, GetMemberOptions)

public override IEnumerable<IMethod> GetMethods(IReadOnlyList<IType> typeArguments, Predicate<IMethod> filter = null, GetMemberOptions options = GetMemberOptions.None)

Parameters

typeArguments IReadOnlyList<IType>
filter Predicate<IMethod>
options GetMemberOptions

Returns

IEnumerable<IMethod>

GetMethods(Predicate<IMethod>, GetMemberOptions)

public override IEnumerable<IMethod> GetMethods(Predicate<IMethod> filter = null, GetMemberOptions options = GetMemberOptions.None)

Parameters

filter Predicate<IMethod>
options GetMemberOptions

Returns

IEnumerable<IMethod>

GetNestedTypes(IReadOnlyList<IType>, Predicate<ITypeDefinition>, GetMemberOptions)

public override IEnumerable<IType> GetNestedTypes(IReadOnlyList<IType> typeArguments, Predicate<ITypeDefinition> filter = null, GetMemberOptions options = GetMemberOptions.None)

Parameters

typeArguments IReadOnlyList<IType>
filter Predicate<ITypeDefinition>
options GetMemberOptions

Returns

IEnumerable<IType>

GetNestedTypes(Predicate<ITypeDefinition>, GetMemberOptions)

public override IEnumerable<IType> GetNestedTypes(Predicate<ITypeDefinition> filter = null, GetMemberOptions options = GetMemberOptions.None)

Parameters

filter Predicate<ITypeDefinition>
options GetMemberOptions

Returns

IEnumerable<IType>

GetProperties(Predicate<IProperty>, GetMemberOptions)

public override IEnumerable<IProperty> GetProperties(Predicate<IProperty> filter = null, GetMemberOptions options = GetMemberOptions.None)

Parameters

filter Predicate<IProperty>
options GetMemberOptions

Returns

IEnumerable<IProperty>

GetTupleElementTypes(IType)

Gets the tuple element types from a tuple type or tuple underlying type.

public static ImmutableArray<IType> GetTupleElementTypes(IType tupleType)

Parameters

tupleType IType

Returns

ImmutableArray<IType>

IsTupleCompatible(IType, out int)

Gets whether the specified type is a valid underlying type for a tuple. Also returns true for tuple types themselves.

public static bool IsTupleCompatible(IType type, out int tupleCardinality)

Parameters

type IType
tupleCardinality int

Returns

bool

ToString()

public override string ToString()

Returns

string

VisitChildren(TypeVisitor)

public override IType VisitChildren(TypeVisitor visitor)

Parameters

visitor TypeVisitor

Returns

IType