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
ICompilationelementTypes
ImmutableArray<IType>elementNames
ImmutableArray<string>valueTupleAssembly
IModule
Fields
RestPosition
public const int RestPosition = 8
Field Value
Properties
Cardinality
Gets the cardinality of the tuple.
public int Cardinality { get; }
Property Value
Compilation
Gets the parent compilation. This property never returns null.
public ICompilation Compilation { get; }
Property Value
DirectBaseTypes
public override IEnumerable<IType> DirectBaseTypes { get; }
Property Value
ElementNames
Gets the names of the tuple elements.
public ImmutableArray<string> ElementNames { get; }
Property Value
ElementTypes
Gets the tuple elements.
public ImmutableArray<IType> ElementTypes { get; }
Property Value
FullName
public override string FullName { get; }
Property Value
IsReferenceType
public override bool? IsReferenceType { get; }
Property Value
- bool?
Kind
Gets the type kind.
public override TypeKind Kind { get; }
Property Value
Name
public override string Name { get; }
Property Value
Namespace
Gets the full name of the namespace containing this entity.
public override string Namespace { get; }
Property Value
ReflectionName
public override string ReflectionName { get; }
Property Value
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
TypeParameterCount
Gets the number of type parameters.
public override int TypeParameterCount { get; }
Property Value
TypeParameters
Gets the type parameters. Returns an empty list if this type is not generic.
public override IReadOnlyList<ITypeParameter> TypeParameters { get; }
Property Value
UnderlyingType
Gets the underlying System.ValueType
type.
public ParameterizedType UnderlyingType { get; }
Property Value
Methods
AcceptVisitor(TypeVisitor)
public override IType AcceptVisitor(TypeVisitor visitor)
Parameters
visitor
TypeVisitor
Returns
Equals(IType)
public override bool Equals(IType other)
Parameters
other
IType
Returns
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
ICompilationtype
IType
Returns
GetAccessors(Predicate<IMethod>, GetMemberOptions)
public override IEnumerable<IMethod> GetAccessors(Predicate<IMethod> filter = null, GetMemberOptions options = GetMemberOptions.None)
Parameters
filter
Predicate<IMethod>options
GetMemberOptions
Returns
GetConstructors(Predicate<IMethod>, GetMemberOptions)
public override IEnumerable<IMethod> GetConstructors(Predicate<IMethod> filter = null, GetMemberOptions options = GetMemberOptions.IgnoreInheritedMembers)
Parameters
filter
Predicate<IMethod>options
GetMemberOptions
Returns
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
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
GetEvents(Predicate<IEvent>, GetMemberOptions)
public override IEnumerable<IEvent> GetEvents(Predicate<IEvent> filter = null, GetMemberOptions options = GetMemberOptions.None)
Parameters
filter
Predicate<IEvent>options
GetMemberOptions
Returns
GetFields(Predicate<IField>, GetMemberOptions)
public override IEnumerable<IField> GetFields(Predicate<IField> filter = null, GetMemberOptions options = GetMemberOptions.None)
Parameters
filter
Predicate<IField>options
GetMemberOptions
Returns
GetHashCode()
public override int GetHashCode()
Returns
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
GetMethods(Predicate<IMethod>, GetMemberOptions)
public override IEnumerable<IMethod> GetMethods(Predicate<IMethod> filter = null, GetMemberOptions options = GetMemberOptions.None)
Parameters
filter
Predicate<IMethod>options
GetMemberOptions
Returns
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
GetNestedTypes(Predicate<ITypeDefinition>, GetMemberOptions)
public override IEnumerable<IType> GetNestedTypes(Predicate<ITypeDefinition> filter = null, GetMemberOptions options = GetMemberOptions.None)
Parameters
filter
Predicate<ITypeDefinition>options
GetMemberOptions
Returns
GetProperties(Predicate<IProperty>, GetMemberOptions)
public override IEnumerable<IProperty> GetProperties(Predicate<IProperty> filter = null, GetMemberOptions options = GetMemberOptions.None)
Parameters
filter
Predicate<IProperty>options
GetMemberOptions
Returns
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
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
Returns
ToString()
public override string ToString()
Returns
VisitChildren(TypeVisitor)
public override IType VisitChildren(TypeVisitor visitor)
Parameters
visitor
TypeVisitor