Table of Contents

Class GenericInstanceTypeSignaturePattern

Namespace
CilFi.Patterns
Assembly
CilFi.Core.dll

Defines the pattern matching on generic instance type signatures.

[GenerateKeyedMatchNode]
public record GenericInstanceTypeSignaturePattern : Pattern<TypeSignature>, IEquatable<Pattern>, IEquatable<Pattern<TypeSignature>>, IEquatable<GenericInstanceTypeSignaturePattern>
Inheritance
GenericInstanceTypeSignaturePattern
Implements
Inherited Members

Constructors

GenericInstanceTypeSignaturePattern(GenericInstanceTypeSignaturePattern)

protected GenericInstanceTypeSignaturePattern(GenericInstanceTypeSignaturePattern original)

Parameters

original GenericInstanceTypeSignaturePattern

GenericInstanceTypeSignaturePattern(Pattern<bool>, Pattern<ITypeDefOrRef>, Pattern<IList<TypeSignature>>)

Defines the pattern matching on generic instance type signatures.

public GenericInstanceTypeSignaturePattern(Pattern<bool> IsValueType, Pattern<ITypeDefOrRef> GenericType, Pattern<IList<TypeSignature>> TypeArguments)

Parameters

IsValueType Pattern<bool>

The pattern describing whether the type is expected to be a value type or not.

GenericType Pattern<ITypeDefOrRef>

The pattern describing the underlying type reference.

TypeArguments Pattern<IList<TypeSignature>>

The pattern describing the generic type arguments.

Properties

EqualityContract

protected override Type EqualityContract { get; }

Property Value

Type

GenericType

The pattern describing the underlying type reference.

public Pattern<ITypeDefOrRef> GenericType { get; init; }

Property Value

Pattern<ITypeDefOrRef>

IsValueType

The pattern describing whether the type is expected to be a value type or not.

public Pattern<bool> IsValueType { get; init; }

Property Value

Pattern<bool>

TypeArguments

The pattern describing the generic type arguments.

public Pattern<IList<TypeSignature>> TypeArguments { get; init; }

Property Value

Pattern<IList<TypeSignature>>

Methods

Deconstruct(out Pattern<bool>, out Pattern<ITypeDefOrRef>, out Pattern<IList<TypeSignature>>)

public void Deconstruct(out Pattern<bool> IsValueType, out Pattern<ITypeDefOrRef> GenericType, out Pattern<IList<TypeSignature>> TypeArguments)

Parameters

IsValueType Pattern<bool>
GenericType Pattern<ITypeDefOrRef>
TypeArguments Pattern<IList<TypeSignature>>

Equals(GenericInstanceTypeSignaturePattern?)

public virtual bool Equals(GenericInstanceTypeSignaturePattern? other)

Parameters

other GenericInstanceTypeSignaturePattern

Returns

bool

Equals(Pattern<TypeSignature>?)

public override sealed bool Equals(Pattern<TypeSignature>? other)

Parameters

other Pattern<TypeSignature>

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

Format(IndentedTextWriter)

Serializes the pattern to a readable string.

public override void Format(IndentedTextWriter writer)

Parameters

writer IndentedTextWriter

The output stream.

GetHashCode()

public override int GetHashCode()

Returns

int

Match(TypeSignature, MatchingContext)

Attempts to match the provided input to the pattern.

public override IMatchNode<TypeSignature>? Match(TypeSignature input, MatchingContext context)

Parameters

input TypeSignature

The input to match.

context MatchingContext

The context in which to match the pattern to.

Returns

IMatchNode<TypeSignature>

When successful, returns the root node of the match tree, otherwise null.

PrintMembers(StringBuilder)

protected override bool PrintMembers(StringBuilder builder)

Parameters

builder StringBuilder

Returns

bool

Operators

operator ==(GenericInstanceTypeSignaturePattern?, GenericInstanceTypeSignaturePattern?)

public static bool operator ==(GenericInstanceTypeSignaturePattern? left, GenericInstanceTypeSignaturePattern? right)

Parameters

left GenericInstanceTypeSignaturePattern
right GenericInstanceTypeSignaturePattern

Returns

bool

operator !=(GenericInstanceTypeSignaturePattern?, GenericInstanceTypeSignaturePattern?)

public static bool operator !=(GenericInstanceTypeSignaturePattern? left, GenericInstanceTypeSignaturePattern? right)

Parameters

left GenericInstanceTypeSignaturePattern
right GenericInstanceTypeSignaturePattern

Returns

bool