Interface ITypeParameter
- Namespace
- ICSharpCode.Decompiler.TypeSystem
- Assembly
- ICSharpCode.Decompiler.dll
Type parameter of a generic class/method.
public interface ITypeParameter : IType, INamedElement, IEquatable<IType>, ISymbol
- Inherited Members
- Extension Methods
Properties
EffectiveBaseClass
Gets the effective base class of this type parameter.
IType EffectiveBaseClass { get; }
Property Value
EffectiveInterfaceSet
Gets the effective interface set of this type parameter.
IReadOnlyCollection<IType> EffectiveInterfaceSet { get; }
Property Value
HasDefaultConstructorConstraint
Gets if the type parameter has the 'new()' constraint.
bool HasDefaultConstructorConstraint { get; }
Property Value
HasReferenceTypeConstraint
Gets if the type parameter has the 'class' constraint.
bool HasReferenceTypeConstraint { get; }
Property Value
HasUnmanagedConstraint
Gets if the type parameter has the 'unmanaged' constraint.
bool HasUnmanagedConstraint { get; }
Property Value
HasValueTypeConstraint
Gets if the type parameter has the 'struct' or 'unmanaged' constraint.
bool HasValueTypeConstraint { get; }
Property Value
Index
Gets the index of the type parameter in the type parameter list of the owning method/class.
int Index { get; }
Property Value
Name
Gets the name of the type parameter.
string Name { get; }
Property Value
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;"
Nullability NullabilityConstraint { get; }
Property Value
Owner
Gets the owning method/class. This property may return null (for example for the dummy type parameters used by ReplaceMethodTypeParametersWithDummy).
IEntity? Owner { get; }
Property Value
Remarks
For "class Outer<T> { class Inner {} }",
inner.TypeParameters[0].Owner will be the outer class, because the same
ITypeParameter instance is used both on Outer1 and Outer
1+Inner.
OwnerType
Get the type of this type parameter's owner.
SymbolKind OwnerType { get; }
Property Value
- SymbolKind
SymbolKind.TypeDefinition or SymbolKind.Method
TypeConstraints
IReadOnlyList<TypeConstraint> TypeConstraints { get; }
Property Value
Variance
Gets the variance of this type parameter.
VarianceModifier Variance { get; }
Property Value
Methods
GetAttributes()
Gets the attributes declared on this type parameter.
IEnumerable<IAttribute> GetAttributes()