Table of Contents

Class AbstractTypeParameter

Namespace
ICSharpCode.Decompiler.TypeSystem.Implementation
Assembly
ICSharpCode.Decompiler.dll
public abstract class AbstractTypeParameter : ITypeParameter, IType, INamedElement, IEquatable<IType>, ISymbol, ICompilationProvider
Inheritance
AbstractTypeParameter
Implements
Derived
Inherited Members
Extension Methods

Constructors

AbstractTypeParameter(ICompilation, SymbolKind, int, string, VarianceModifier)

protected AbstractTypeParameter(ICompilation compilation, SymbolKind ownerType, int index, string name, VarianceModifier variance)

Parameters

compilation ICompilation
ownerType SymbolKind
index int
name string
variance VarianceModifier

AbstractTypeParameter(IEntity, int, string, VarianceModifier)

protected AbstractTypeParameter(IEntity owner, int index, string name, VarianceModifier variance)

Parameters

owner IEntity
index int
name string
variance VarianceModifier

Properties

Compilation

Gets the parent compilation. This property never returns null.

public ICompilation Compilation { get; }

Property Value

ICompilation

DirectBaseTypes

public IEnumerable<IType> DirectBaseTypes { get; }

Property Value

IEnumerable<IType>

EffectiveBaseClass

Gets the effective base class of this type parameter.

public IType EffectiveBaseClass { get; }

Property Value

IType

EffectiveInterfaceSet

Gets the effective interface set of this type parameter.

public IReadOnlyCollection<IType> EffectiveInterfaceSet { get; }

Property Value

IReadOnlyCollection<IType>

HasDefaultConstructorConstraint

Gets if the type parameter has the 'new()' constraint.

public abstract bool HasDefaultConstructorConstraint { get; }

Property Value

bool

HasReferenceTypeConstraint

Gets if the type parameter has the 'class' constraint.

public abstract bool HasReferenceTypeConstraint { get; }

Property Value

bool

HasUnmanagedConstraint

Gets if the type parameter has the 'unmanaged' constraint.

public abstract bool HasUnmanagedConstraint { get; }

Property Value

bool

HasValueTypeConstraint

Gets if the type parameter has the 'struct' or 'unmanaged' constraint.

public abstract bool HasValueTypeConstraint { get; }

Property Value

bool

Index

Gets the index of the type parameter in the type parameter list of the owning method/class.

public int Index { get; }

Property Value

int

IsReferenceType

public bool? IsReferenceType { get; }

Property Value

bool?

Kind

Gets the type kind.

public TypeKind Kind { get; }

Property Value

TypeKind

Name

Gets the name of the type parameter.

public string Name { get; }

Property Value

string

NullabilityConstraint

Nullability of the reference type constraint. (e.g. "where T : class?").

Note that the nullability of a use of the type parameter may differ from this. E.g. "T? GetNull<T>() where T : class => null;"

public abstract Nullability NullabilityConstraint { get; }

Property Value

Nullability

Owner

public IEntity Owner { get; }

Property Value

IEntity

OwnerType

public SymbolKind OwnerType { get; }

Property Value

SymbolKind

ReflectionName

public string ReflectionName { get; }

Property Value

string

TypeConstraints

public abstract IReadOnlyList<TypeConstraint> TypeConstraints { get; }

Property Value

IReadOnlyList<TypeConstraint>

Variance

Gets the variance of this type parameter.

public VarianceModifier Variance { get; }

Property Value

VarianceModifier

Methods

AcceptVisitor(TypeVisitor)

public IType AcceptVisitor(TypeVisitor visitor)

Parameters

visitor TypeVisitor

Returns

IType

ChangeNullability(Nullability)

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

public IType ChangeNullability(Nullability nullability)

Parameters

nullability Nullability

Returns

IType

Equals(IType)

public virtual bool Equals(IType other)

Parameters

other IType

Returns

bool

Equals(object)

public override sealed bool Equals(object obj)

Parameters

obj object

Returns

bool

GetAccessors(Predicate<IMethod>, GetMemberOptions)

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

Parameters

filter Predicate<IMethod>
options GetMemberOptions

Returns

IEnumerable<IMethod>

GetAttributes()

Gets the attributes declared on this type parameter.

public abstract IEnumerable<IAttribute> GetAttributes()

Returns

IEnumerable<IAttribute>

GetConstructors(Predicate<IMethod>, GetMemberOptions)

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

Parameters

filter Predicate<IMethod>
options GetMemberOptions

Returns

IEnumerable<IMethod>

GetEvents(Predicate<IEvent>, GetMemberOptions)

public 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 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

GetMembers(Predicate<IMember>, GetMemberOptions)

public IEnumerable<IMember> GetMembers(Predicate<IMember> filter = null, GetMemberOptions options = GetMemberOptions.None)

Parameters

filter Predicate<IMember>
options GetMemberOptions

Returns

IEnumerable<IMember>

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

public 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 IEnumerable<IMethod> GetMethods(Predicate<IMethod> filter = null, GetMemberOptions options = GetMemberOptions.None)

Parameters

filter Predicate<IMethod>
options GetMemberOptions

Returns

IEnumerable<IMethod>

GetProperties(Predicate<IProperty>, GetMemberOptions)

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

Parameters

filter Predicate<IProperty>
options GetMemberOptions

Returns

IEnumerable<IProperty>

ToString()

public override string ToString()

Returns

string

VisitChildren(TypeVisitor)

public IType VisitChildren(TypeVisitor visitor)

Parameters

visitor TypeVisitor

Returns

IType