/// <inheritdoc /> public bool Equals(SentinelTypeSignature x, SentinelTypeSignature y) { if (ReferenceEquals(x, y)) { return(true); } if (x is null || y is null) { return(false); } return(x.ElementType == y.ElementType); }
/// <summary> /// Determines whether two types are considered equal according to their signature. /// </summary> /// <param name="signature1">The first type to compare.</param> /// <param name="signature2">The second type to compare.</param> /// <returns><c>True</c> if the types are considered equal, <c>False</c> otherwise.</returns> public bool Equals(SentinelTypeSignature signature1, SentinelTypeSignature signature2) { if (signature1 == null && signature2 == null) { return(true); } if (signature1 == null || signature2 == null) { return(false); } return(Equals(signature1.BaseType, signature2.BaseType)); }
private SentinelTypeSignature ImportSentinelTypeSignature(SentinelTypeSignature sentinelType) { return(new SentinelTypeSignature(ImportTypeSignature(sentinelType.BaseType))); }
/// <inheritdoc /> public int GetHashCode(SentinelTypeSignature obj) => (int)obj.ElementType << ElementTypeOffset;
/// <inheritdoc /> public object VisitSentinelType(SentinelTypeSignature signature) => throw new NotSupportedException();
/// <inheritdoc /> public TypeMemoryLayout VisitSentinelType(SentinelTypeSignature signature) => throw new ArgumentException("Sentinel types do not have a size.");