Exemplo n.º 1
0
 /// <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);
 }
Exemplo n.º 2
0
        /// <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));
        }
Exemplo n.º 3
0
 private SentinelTypeSignature ImportSentinelTypeSignature(SentinelTypeSignature sentinelType)
 {
     return(new SentinelTypeSignature(ImportTypeSignature(sentinelType.BaseType)));
 }
Exemplo n.º 4
0
 /// <inheritdoc />
 public int GetHashCode(SentinelTypeSignature obj) =>
 (int)obj.ElementType << ElementTypeOffset;
Exemplo n.º 5
0
 /// <inheritdoc />
 public object VisitSentinelType(SentinelTypeSignature signature) => throw new NotSupportedException();
Exemplo n.º 6
0
 /// <inheritdoc />
 public TypeMemoryLayout VisitSentinelType(SentinelTypeSignature signature) =>
 throw new ArgumentException("Sentinel types do not have a size.");