CxTypeParameter

Description

sealed class Tinman.Core.Cx.Declarations.CxTypeParameter

Represents a generic type parameter of a type or member:

Prefix part:

<    T> ...
<in  T> ...
<out T> ...
     \____ Name
 \____ Semantic

Suffix part:

... where T : struct
              \____ IsStruct

... where T : class, Type1, ..., TypeN, new()
              |      \____ BaseTypes    \____ IsNew
              \____ IsClass

Public / Constants

Context​Where


public constant ContextWhere → ("type-parameter-where":string)

Output the where part, instead of the <..> part?

Public / Constructors

Cx​Type​Parameter


public constructor CxTypeParameter → (6)

name in : CxId

See ICxIdContainer.Name.

semantic opt : int32 = 0

See Semantic.

isClass opt : bool = true

See IsClass.

isStruct opt : bool = false

See IsStruct.

isNew opt : bool = false

See IsNew.

baseTypes opt : IBagConst<CxTypeName> = null

The base type list or null for an empty list. See ICxBaseTypesContainer.BaseTypes.

Creates a new instance of CxTypeParameter.

Public / Attributes

Has​Where


[Constant]
public attribute HasWhere → (get)

value : bool

true if this type parameter has a where part,
false if not.

Does this type parameter has a where part?

Is​Class


[Constant]
public attribute IsClass → (get)

value : bool

true if the type must be a reference type,
false if not.

Returns whether the type parameter must be a reference type.

Is​New


[Constant]
public attribute IsNew → (get)

value : bool

true if the type must have a default constructor,
false if not.

Returns whether the type parameter must have a default constructor.

Is​Struct


[Constant]
public attribute IsStruct → (get)

value : bool

true if the type must be a value type,
false if not.

Returns whether the type parameter must be a value type.

Semantic


public attribute Semantic → (get)

value : int32

< 0 : the type parameter is co-variant (keyword out)
= 0 : the type parameter is invariant (no keyword)
> 0 : the type parameter is contra-variant (keyword in)

Returns the semantic of the type parameter.