public override bool IsOverloadAllowed(MemberContainer overload)
        {
            //
            // Two members can differ in their explicit interface
            // type parameter only
            //
            InterfaceMemberContainer imb = overload as InterfaceMemberContainer;

            if (imb != null && imb.IsExplicitInterfaceImplementation)
            {
                if (IsExplicitInterfaceImplementation)
                {
                    caching_flags |= Flags.MethodOverloadsExist;
                }
                return(true);
            }

            return(IsExplicitInterfaceImplementation);
        }
Exemple #2
0
        //
        // Adds the member to defined_names table. It tests for duplications and enclosing name conflicts
        //
        public virtual void AddNameToContainer(EntityCore symbol, string name)
        {
            if (((ModFlags | symbol.ModFlags) & Modifiers.COMPILER_GENERATED) != 0)
            {
                return;
            }

            EntityCore mc;

            if (!defined_names.TryGetValue(name, out mc))
            {
                defined_names.Add(name, symbol);
                return;
            }


            InterfaceMemberContainer im = mc as InterfaceMemberContainer;

            if (im != null && im.IsExplicitInterfaceImplementation)
            {
                return;
            }

            if ((mc.ModFlags & Modifiers.PARTIAL) != 0 && (symbol is ClassOrStructDeclaration || symbol is InterfaceDeclaration))
            {
                Report.Error(0, symbol.Location,
                             "Missing partial modifier on declaration of type `{0}'. Another partial declaration of this type exists",
                             symbol.GetSignatureForError());
                return;
            }


            Report.Error(0, symbol.Location,
                         "The type `{0}' already contains a definition for `{1}'",
                         GetSignatureForError(), name);


            return;
        }
Exemple #3
0
 static MemberName SetupName(string prefix, InterfaceMemberContainer member, Location loc)
 {
     return(new MemberName(member.MemberName.Left, prefix + member.Name, member.MemberName.ExplicitInterface, loc));
 }