Table of Contents

Class PinnedTypeSignature

Namespace
AsmResolver.DotNet.Signatures
Assembly
AsmResolver.DotNet.dll

Represents a type modifier indicating the value is pinned into memory, and the garbage collector cannot change the location of a value at runtime.

public class PinnedTypeSignature : TypeSpecificationSignature, ITypeDescriptor, IMemberDescriptor, IFullNameProvider, INameProvider, IModuleProvider, IImportable
Inheritance
PinnedTypeSignature
Implements
Inherited Members
Extension Methods

Constructors

PinnedTypeSignature(TypeSignature)

Creates a new pinned type signature.

public PinnedTypeSignature(TypeSignature baseType)

Parameters

baseType TypeSignature

The type to pin.

Properties

ElementType

Gets the element type of the

public override ElementType ElementType { get; }

Property Value

ElementType

IsValueType

Gets a value indicating whether instances of this type are passed on by value or by reference.

public override bool IsValueType { get; }

Property Value

bool

Name

Gets the name of the object.

public override string? Name { get; }

Property Value

string

Methods

AcceptVisitor<TResult>(ITypeSignatureVisitor<TResult>)

Visit the current type signature using the provided visitor.

public override TResult AcceptVisitor<TResult>(ITypeSignatureVisitor<TResult> visitor)

Parameters

visitor ITypeSignatureVisitor<TResult>

The visitor to accept.

Returns

TResult

The result the visitor produced after visiting this type signature.

Type Parameters

TResult

The type of result the visitor produces.

AcceptVisitor<TState, TResult>(ITypeSignatureVisitor<TState, TResult>, TState)

Visit the current type signature using the provided visitor.

public override TResult AcceptVisitor<TState, TResult>(ITypeSignatureVisitor<TState, TResult> visitor, TState state)

Parameters

visitor ITypeSignatureVisitor<TState, TResult>

The visitor to accept.

state TState

Additional state.

Returns

TResult

The result the visitor produced after visiting this type signature.

Type Parameters

TState

The type of additional state.

TResult

The type of result the visitor produces.

GetDirectBaseClass()

Obtains the direct base class of the type signature.

public override TypeSignature? GetDirectBaseClass()

Returns

TypeSignature

The type representing the immediate base class.

Remarks

The direct base class is computed according to the rules defined in ECMA-335 I.8.7, where interfaces will extend object, and generic base types will be instantiated with the derived classes type arguments (if any).

GetIntermediateType()

Obtains the intermediate type of the type signature.

public override TypeSignature GetIntermediateType()

Returns

TypeSignature

The intermediate type.

Remarks

As per ECMA-335 I.8.7, intermediate types are a subset of the built-in value types can be represented on the evaluation stack.

GetReducedType()

Obtains the reduced type of the type signature.

public override TypeSignature GetReducedType()

Returns

TypeSignature

The reduced type.

Remarks

As per ECMA-335 I.8.7, the reduced type ignores the semantic differences between enumerations and the signed and unsigned integer types; treating these types the same if they have the same number of bits.

GetVerificationType()

Obtains the verification type of the type signature.

public override TypeSignature GetVerificationType()

Returns

TypeSignature

The verification type.

Remarks

As per ECMA-335 I.8.7, the verification type ignores the semantic differences between enumerations, characters, booleans, the signed and unsigned integer types, and managed pointers to any of these; treating these types the same if they have the same number of bits or point to types with the same number of bits.

StripModifiers()

Strips any top-level custom type modifier and pinned type annotations from the signature.

public override TypeSignature StripModifiers()

Returns

TypeSignature

The stripped type signature.

Remarks

This method does not necessarily recursively strip away every modifier type from the signature, nor does it allocate new type signatures or change existing ones. It only traverses the type signature until a non-modifier or pinned type is encountered. Annotations that are embedded in the type signature (e.g., as a type argument of a generic instance type), will not be automatically removed.