Class TypeSpecificationPattern
Defines the pattern matching type specifications.
[GenerateKeyedMatchNode]
public record TypeSpecificationPattern : Pattern<ITypeDefOrRef?>, IEquatable<Pattern>, IEquatable<Pattern<ITypeDefOrRef?>>, IEquatable<TypeSpecificationPattern>
- Inheritance
-
TypeSpecificationPattern
- Implements
- Inherited Members
- Extension Methods
Constructors
TypeSpecificationPattern(Pattern<TypeSignature>)
Defines the pattern matching type specifications.
public TypeSpecificationPattern(Pattern<TypeSignature> Signature)
Parameters
SignaturePattern<TypeSignature>The pattern described the wrapped type signature.
TypeSpecificationPattern(TypeSpecificationPattern)
protected TypeSpecificationPattern(TypeSpecificationPattern original)
Parameters
originalTypeSpecificationPattern
Properties
EqualityContract
protected override Type EqualityContract { get; }
Property Value
Signature
The pattern described the wrapped type signature.
public Pattern<TypeSignature> Signature { get; init; }
Property Value
Methods
Deconstruct(out Pattern<TypeSignature>)
public void Deconstruct(out Pattern<TypeSignature> Signature)
Parameters
SignaturePattern<TypeSignature>
Equals(Pattern<ITypeDefOrRef?>?)
public override sealed bool Equals(Pattern<ITypeDefOrRef?>? other)
Parameters
otherPattern<ITypeDefOrRef>
Returns
Equals(TypeSpecificationPattern?)
public virtual bool Equals(TypeSpecificationPattern? other)
Parameters
otherTypeSpecificationPattern
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
Format(IndentedTextWriter)
Serializes the pattern to a readable string.
public override void Format(IndentedTextWriter writer)
Parameters
writerIndentedTextWriterThe output stream.
GetHashCode()
public override int GetHashCode()
Returns
Match(ITypeDefOrRef?, MatchingContext)
Attempts to match the provided input to the pattern.
public override IMatchNode<ITypeDefOrRef?>? Match(ITypeDefOrRef? input, MatchingContext context)
Parameters
inputITypeDefOrRefThe input to match.
contextMatchingContextThe context in which to match the pattern to.
Returns
- IMatchNode<ITypeDefOrRef>
When successful, returns the root node of the match tree, otherwise
null.
PrintMembers(StringBuilder)
protected override bool PrintMembers(StringBuilder builder)
Parameters
builderStringBuilder
Returns
Operators
operator ==(TypeSpecificationPattern?, TypeSpecificationPattern?)
public static bool operator ==(TypeSpecificationPattern? left, TypeSpecificationPattern? right)
Parameters
leftTypeSpecificationPatternrightTypeSpecificationPattern
Returns
operator !=(TypeSpecificationPattern?, TypeSpecificationPattern?)
public static bool operator !=(TypeSpecificationPattern? left, TypeSpecificationPattern? right)
Parameters
leftTypeSpecificationPatternrightTypeSpecificationPattern