public bool Equals()

in src/Microsoft.Diagnostics.Runtime/ClrType.cs [414:437]


        public bool Equals(ClrType? other)
        {
            if (ReferenceEquals(this, other))
                return true;

            if (other is null)
                return false;

            if (MethodTable != 0 && other.MethodTable != 0)
                return MethodTable == other.MethodTable;

            if (other.IsPointer)
                return ComponentType == other.ComponentType;

            if (IsPrimitive && other.IsPrimitive && ElementType != ClrElementType.Unknown)
                return ElementType == other.ElementType;

            // Ok we aren't a primitive type, or a pointer, and our MethodTables are 0.  Last resort is to
            // check if we resolved from the same token out of the same module.
            if (Module != null && MetadataToken != 0)
                return Module == other.Module && MetadataToken == other.MetadataToken;

            return false;
        }