Class GenericParameterSignaturePattern
Defines the pattern matching on generic parameter signatures.
[GenerateKeyedMatchNode]
public record GenericParameterSignaturePattern : Pattern<TypeSignature>, IEquatable<Pattern>, IEquatable<Pattern<TypeSignature>>, IEquatable<GenericParameterSignaturePattern>
- Inheritance
-
GenericParameterSignaturePattern
- Implements
- Inherited Members
Constructors
GenericParameterSignaturePattern(GenericParameterType, Pattern<int>)
Defines the pattern matching on generic parameter signatures.
public GenericParameterSignaturePattern(GenericParameterType Type, Pattern<int> Index)
Parameters
TypeGenericParameterTypeThe type of the generic parameter.
IndexPattern<int>The pattern describing the index of the parameter.
GenericParameterSignaturePattern(GenericParameterSignaturePattern)
protected GenericParameterSignaturePattern(GenericParameterSignaturePattern original)
Parameters
originalGenericParameterSignaturePattern
Properties
EqualityContract
protected override Type EqualityContract { get; }
Property Value
Index
The pattern describing the index of the parameter.
public Pattern<int> Index { get; init; }
Property Value
Type
The type of the generic parameter.
public GenericParameterType Type { get; init; }
Property Value
Methods
Deconstruct(out GenericParameterType, out Pattern<int>)
public void Deconstruct(out GenericParameterType Type, out Pattern<int> Index)
Parameters
TypeGenericParameterTypeIndexPattern<int>
Equals(GenericParameterSignaturePattern?)
public virtual bool Equals(GenericParameterSignaturePattern? other)
Parameters
Returns
Equals(Pattern<TypeSignature>?)
public override sealed bool Equals(Pattern<TypeSignature>? other)
Parameters
otherPattern<TypeSignature>
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(TypeSignature, MatchingContext)
Attempts to match the provided input to the pattern.
public override IMatchNode<TypeSignature>? Match(TypeSignature input, MatchingContext context)
Parameters
inputTypeSignatureThe input to match.
contextMatchingContextThe 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
builderStringBuilder
Returns
Operators
operator ==(GenericParameterSignaturePattern?, GenericParameterSignaturePattern?)
public static bool operator ==(GenericParameterSignaturePattern? left, GenericParameterSignaturePattern? right)
Parameters
Returns
operator !=(GenericParameterSignaturePattern?, GenericParameterSignaturePattern?)
public static bool operator !=(GenericParameterSignaturePattern? left, GenericParameterSignaturePattern? right)