Class TypeDefOrRefPattern
Defines a pattern matching on type signatures.
[GenerateKeyedMatchNode]
public record TypeDefOrRefPattern : Pattern<TypeSignature?>, IEquatable<Pattern>, IEquatable<Pattern<TypeSignature?>>, IEquatable<TypeDefOrRefPattern>
- Inheritance
-
TypeDefOrRefPattern
- Implements
- Inherited Members
Constructors
TypeDefOrRefPattern(Pattern<bool>, Pattern<ITypeDefOrRef>)
Defines a pattern matching on type signatures.
public TypeDefOrRefPattern(Pattern<bool> IsValueType, Pattern<ITypeDefOrRef> Type)
Parameters
IsValueTypePattern<bool>The pattern describing whether the type is expected to be a value type.
TypePattern<ITypeDefOrRef>The pattern describing the underlying type identifier.
TypeDefOrRefPattern(TypeDefOrRefPattern)
protected TypeDefOrRefPattern(TypeDefOrRefPattern original)
Parameters
originalTypeDefOrRefPattern
Fields
Boolean
public static readonly TypeDefOrRefPattern Boolean
Field Value
Byte
public static readonly TypeDefOrRefPattern Byte
Field Value
Char
public static readonly TypeDefOrRefPattern Char
Field Value
Double
public static readonly TypeDefOrRefPattern Double
Field Value
Int16
public static readonly TypeDefOrRefPattern Int16
Field Value
Int32
public static readonly TypeDefOrRefPattern Int32
Field Value
Int64
public static readonly TypeDefOrRefPattern Int64
Field Value
IntPtr
public static readonly TypeDefOrRefPattern IntPtr
Field Value
Object
public static readonly TypeDefOrRefPattern Object
Field Value
SByte
public static readonly TypeDefOrRefPattern SByte
Field Value
Single
public static readonly TypeDefOrRefPattern Single
Field Value
String
public static readonly TypeDefOrRefPattern String
Field Value
TypedReference
public static readonly TypeDefOrRefPattern TypedReference
Field Value
UInt16
public static readonly TypeDefOrRefPattern UInt16
Field Value
UInt32
public static readonly TypeDefOrRefPattern UInt32
Field Value
UInt64
public static readonly TypeDefOrRefPattern UInt64
Field Value
UIntPtr
public static readonly TypeDefOrRefPattern UIntPtr
Field Value
Void
public static readonly TypeDefOrRefPattern Void
Field Value
Properties
EqualityContract
protected override Type EqualityContract { get; }
Property Value
IsValueType
The pattern describing whether the type is expected to be a value type.
public Pattern<bool> IsValueType { get; init; }
Property Value
Type
The pattern describing the underlying type identifier.
public Pattern<ITypeDefOrRef> Type { get; init; }
Property Value
Methods
Deconstruct(out Pattern<bool>, out Pattern<ITypeDefOrRef>)
public void Deconstruct(out Pattern<bool> IsValueType, out Pattern<ITypeDefOrRef> Type)
Parameters
IsValueTypePattern<bool>TypePattern<ITypeDefOrRef>
Equals(Pattern<TypeSignature?>?)
public override sealed bool Equals(Pattern<TypeSignature?>? other)
Parameters
otherPattern<TypeSignature>
Returns
Equals(TypeDefOrRefPattern?)
public virtual bool Equals(TypeDefOrRefPattern? other)
Parameters
otherTypeDefOrRefPattern
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? signature, MatchingContext context)
Parameters
signatureTypeSignaturecontextMatchingContextThe 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 ==(TypeDefOrRefPattern?, TypeDefOrRefPattern?)
public static bool operator ==(TypeDefOrRefPattern? left, TypeDefOrRefPattern? right)
Parameters
leftTypeDefOrRefPatternrightTypeDefOrRefPattern
Returns
operator !=(TypeDefOrRefPattern?, TypeDefOrRefPattern?)
public static bool operator !=(TypeDefOrRefPattern? left, TypeDefOrRefPattern? right)
Parameters
leftTypeDefOrRefPatternrightTypeDefOrRefPattern