PublicApiGenericParameter Class

A generic parameter of a type or of a method, with its constraints.

public sealed class PublicApiGenericParameter

Properties

NameDescription
AllowsRefLikeTypeGets a value indicating whether the parameter has the allows ref struct anti-constraint.
Attributes
ConstraintTypesGets the base type and interface constraints: the base type, then the other constraints sorted by name. The System.ValueType constraint that encodes struct is not included.
HasConstructorConstraintGets a value indicating whether the parameter has the new() constraint. It is not set when the struct constraint implies it.
HasReferenceTypeConstraintGets a value indicating whether the parameter has the class constraint.
HasUnmanagedTypeConstraint
HasValueTypeConstraintGets a value indicating whether the parameter has the struct constraint. It is also set for the unmanaged constraint.
IsMethodTypeParameter
Name
NullableAnnotationGets the nullable annotation of the generic parameter. With the class constraint, PublicApiNullableAnnotation.Annotated means class?. Without the class and struct constraints, PublicApiNullableAnnotation.NotAnnotated means notnull.
OrdinalGets the position of the generic parameter. For a nested type, the position includes the generic parameters of its containing types, as in metadata.
Variance

Gets a value indicating whether the parameter has the allows ref struct anti-constraint.

public bool AllowsRefLikeType { get; }

Property value

bool

public ImmutableArray<PublicApiAttribute> Attributes { get; }

No documentation is available.

Gets the base type and interface constraints: the base type, then the other constraints sorted by name. The System.ValueType constraint that encodes struct is not included.

public ImmutableArray<PublicApiTypeReference> ConstraintTypes { get; }

HasConstructorConstraint

PublicApiGenericParameter.cs

Gets a value indicating whether the parameter has the new() constraint. It is not set when the struct constraint implies it.

public bool HasConstructorConstraint { get; }

Property value

bool

HasReferenceTypeConstraint

PublicApiGenericParameter.cs

Gets a value indicating whether the parameter has the class constraint.

public bool HasReferenceTypeConstraint { get; }

Property value

bool

HasUnmanagedTypeConstraint

PublicApiGenericParameter.cs
public bool HasUnmanagedTypeConstraint { get; }

Property value

bool

No documentation is available.

HasValueTypeConstraint

PublicApiGenericParameter.cs

Gets a value indicating whether the parameter has the struct constraint. It is also set for the unmanaged constraint.

public bool HasValueTypeConstraint { get; }

Property value

bool

IsMethodTypeParameter

PublicApiGenericParameter.cs
public bool IsMethodTypeParameter { get; }

Property value

bool

No documentation is available.

public string Name { get; }

Property value

string

No documentation is available.

Gets the nullable annotation of the generic parameter. With the class constraint, PublicApiNullableAnnotation.Annotated means class?. Without the class and struct constraints, PublicApiNullableAnnotation.NotAnnotated means notnull.

public PublicApiNullableAnnotation NullableAnnotation { get; }

Gets the position of the generic parameter. For a nested type, the position includes the generic parameters of its containing types, as in metadata.

public int Ordinal { get; }

Property value

int

public PublicApiVariance Variance { get; }

Property value

PublicApiVariance

No documentation is available.

Methods

NameDescription
ToString()
public override string ToString()

Returns

string

No documentation is available.