Ejemplo n.º 1
0
        public override bool Equals(object obj)
        {
            if (!(obj is TemplateArgument))
            {
                return(false);
            }
            var arg = (TemplateArgument)obj;

            if (Kind != arg.Kind)
            {
                return(false);
            }

            switch (Kind)
            {
            case ArgumentKind.Type:
                return(Type.Equals(arg.Type));

            case ArgumentKind.Declaration:
                return(Declaration.Equals(arg.Declaration));

            case ArgumentKind.Integral:
                return(Integral.Equals(arg.Integral));

            case ArgumentKind.Expression:
                return(true);

            default:
                throw new Exception("Unknown TemplateArgument Kind");
            }
        }
Ejemplo n.º 2
0
        public override bool Equals(object obj)
        {
            var type = obj as TemplateParameterSubstitutionType;

            if (type == null)
            {
                return(false);
            }

            return(Replacement.Equals(type.Replacement));
        }
Ejemplo n.º 3
0
        public override bool Equals(object obj)
        {
            var decay = obj as DecayedType;

            if (decay == null)
            {
                return(false);
            }

            return(Original.Equals(decay.Original));
        }
Ejemplo n.º 4
0
        public override bool Equals(object obj)
        {
            var pointer = obj as MemberPointerType;

            if (pointer == null)
            {
                return(false);
            }

            return(QualifiedPointee.Equals(pointer.QualifiedPointee));
        }
Ejemplo n.º 5
0
        public override bool Equals(object obj)
        {
            var type = obj as FunctionType;

            if (type == null)
            {
                return(false);
            }

            return(ReturnType.Equals(type.ReturnType) && Parameters.SequenceEqual(type.Parameters));
        }
Ejemplo n.º 6
0
        public override bool Equals(object obj)
        {
            var attributed = obj as AttributedType;

            if (attributed == null)
            {
                return(false);
            }

            return(Modified.Equals(attributed.Modified) &&
                   Equivalent.Equals(attributed.Equivalent));
        }
Ejemplo n.º 7
0
        public override bool Equals(object obj)
        {
            var type = obj as PointerType;

            if (type == null)
            {
                return(false);
            }

            return(QualifiedPointee.Equals(type.QualifiedPointee) &&
                   Modifier == type.Modifier);
        }
Ejemplo n.º 8
0
        public override bool Equals(object obj)
        {
            var type = obj as ArrayType;

            if (type == null)
            {
                return(false);
            }
            var equals = QualifiedType.Equals(type.QualifiedType) && SizeType.Equals(type.SizeType);

            if (SizeType == ArraySize.Constant)
            {
                equals &= Size.Equals(type.Size);
            }

            return(equals);
        }