Table of Contents

Class DefaultTypeParameter

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

Constructors

DefaultTypeParameter(ICompilation, SymbolKind, int, string, VarianceModifier, IReadOnlyList<IAttribute>, bool, bool, bool, IReadOnlyList<IType>, Nullability)

public DefaultTypeParameter(ICompilation compilation, SymbolKind ownerType, int index, string name = null, VarianceModifier variance = VarianceModifier.Invariant, IReadOnlyList<IAttribute> attributes = null, bool hasValueTypeConstraint = false, bool hasReferenceTypeConstraint = false, bool hasDefaultConstructorConstraint = false, IReadOnlyList<IType> constraints = null, Nullability nullabilityConstraint = Nullability.Oblivious)

Parameters

compilation ICompilation
ownerType SymbolKind
index int
name string
variance VarianceModifier
attributes IReadOnlyList<IAttribute>
hasValueTypeConstraint bool
hasReferenceTypeConstraint bool
hasDefaultConstructorConstraint bool
constraints IReadOnlyList<IType>
nullabilityConstraint Nullability

DefaultTypeParameter(IEntity, int, string, VarianceModifier, IReadOnlyList<IAttribute>, bool, bool, bool, IReadOnlyList<IType>, Nullability)

public DefaultTypeParameter(IEntity owner, int index, string name = null, VarianceModifier variance = VarianceModifier.Invariant, IReadOnlyList<IAttribute> attributes = null, bool hasValueTypeConstraint = false, bool hasReferenceTypeConstraint = false, bool hasDefaultConstructorConstraint = false, IReadOnlyList<IType> constraints = null, Nullability nullabilityConstraint = Nullability.Oblivious)

Parameters

owner IEntity
index int
name string
variance VarianceModifier
attributes IReadOnlyList<IAttribute>
hasValueTypeConstraint bool
hasReferenceTypeConstraint bool
hasDefaultConstructorConstraint bool
constraints IReadOnlyList<IType>
nullabilityConstraint Nullability

Properties

HasDefaultConstructorConstraint

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

public override bool HasDefaultConstructorConstraint { get; }

Property Value

bool

HasReferenceTypeConstraint

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

public override bool HasReferenceTypeConstraint { get; }

Property Value

bool

HasUnmanagedConstraint

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

public override bool HasUnmanagedConstraint { get; }

Property Value

bool

HasValueTypeConstraint

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

public override bool HasValueTypeConstraint { get; }

Property Value

bool

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 override Nullability NullabilityConstraint { get; }

Property Value

Nullability

TypeConstraints

public override IReadOnlyList<TypeConstraint> TypeConstraints { get; }

Property Value

IReadOnlyList<TypeConstraint>

Methods

GetAttributes()

Gets the attributes declared on this type parameter.

public override IEnumerable<IAttribute> GetAttributes()

Returns

IEnumerable<IAttribute>