Table of Contents

Class UnknownType

Namespace
ICSharpCode.Decompiler.TypeSystem.Implementation
Assembly
ICSharpCode.Decompiler.dll

An unknown type where (part) of the name is known.

public class UnknownType : AbstractType, ITypeDefinitionOrUnknown, IType, INamedElement, IEquatable<IType>, ITypeReference
Inheritance
UnknownType
Implements
Inherited Members
Extension Methods

Constructors

UnknownType(FullTypeName, bool?)

Creates a new unknown type.

public UnknownType(FullTypeName fullTypeName, bool? isReferenceType = null)

Parameters

fullTypeName FullTypeName

Full name of the unknown type.

isReferenceType bool?

UnknownType(string, string, int, bool?)

Creates a new unknown type.

public UnknownType(string namespaceName, string name, int typeParameterCount = 0, bool? isReferenceType = null)

Parameters

namespaceName string

Namespace name, if known. Can be null if unknown.

name string

Name of the type, must not be null.

typeParameterCount int

Type parameter count, zero if unknown.

isReferenceType bool?

Properties

FullTypeName

Gets the full name of this type.

public FullTypeName FullTypeName { get; }

Property Value

FullTypeName

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>

Methods

ChangeNullability(Nullability)

Creates a new type that is a copy of this type, with the changed nullability annotation.

public override IType ChangeNullability(Nullability nullability)

Parameters

nullability Nullability

Returns

IType

Equals(IType)

public override bool Equals(IType other)

Parameters

other IType

Returns

bool

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

GetHashCode()

public override int GetHashCode()

Returns

int

ToString()

public override string ToString()

Returns

string