Exemplo n.º 1
0
        private bool Equals(ArrayTypeSymbol other, bool ignoreCustomModifiersAndArraySizesAndLowerBounds, bool ignoreDynamic)
        {
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            if ((object)other == null || !other.HasSameShapeAs(this) ||
                !other.ElementType.Equals(ElementType, ignoreCustomModifiersAndArraySizesAndLowerBounds, ignoreDynamic))
            {
                return(false);
            }

            // Make sure custom modifiers and bounds are the same.
            if (!ignoreCustomModifiersAndArraySizesAndLowerBounds)
            {
                var mod      = this.CustomModifiers;
                var otherMod = other.CustomModifiers;
                var count    = mod.Length;

                if (count != otherMod.Length)
                {
                    return(false);
                }

                for (int i = 0; i < count; i++)
                {
                    if (!mod[i].Equals(otherMod[i]))
                    {
                        return(false);
                    }
                }

                if (!this.HasSameSizesAndLowerBoundsAs(other))
                {
                    return(false);
                }
            }

            return(true);
        }