Open sandboxFocus

Interface ITypeParameter

Represents a generic parameter of a method or type.

Namespace: Metalama.Framework.Code
Assembly: Metalama.Framework.dll
Syntax
public interface ITypeParameter : INamedDeclaration, IDeclaration, IDiagnosticLocation, IMeasurable, IEquatable<IDeclaration>, IType, ICompilationElement, IDisplayable, IEquatable<IType>

Properties

Name Description
AllowsRefStruct

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

HasDefaultConstructorConstraint

Gets a value indicating whether the generic parameter has the new() constraint.

Index

Gets the position of the generic parameter.

IsConstraintNullable

Gets a value indicating whether the Class constraint has the nullable annotation (?). This property returns null if the TypeKindConstraint has a different value than Class or if the nullability of the generic parameter is not analyzed.

ResolvedType

Gets the concrete IType to which the type parameter is resolved, if the parent type or method is a generic instance. If it is a generic definition, returns the current instance.

TypeConstraints

Gets the type constraints of the generic parameter.

TypeKindConstraint

Gets the constraint on the kind of type, e.g. Class or Struct.

TypeParameterKind
Variance

Gets the kind variance: In, Out or None.

Methods

Name Description
ToNonNullable()
ToRef()

Extension Methods