In mcs:
[mono.git] / mcs / gmcs / class.cs
index a59dd573c9f4f5b38191b2d8c55db037443d914b..236c263f77a061d580fc6fff07e3c5c0bc1f52ac 100644 (file)
@@ -486,7 +486,7 @@ namespace Mono.CSharp {
 
                public bool AddToMemberContainer (MemberCore symbol)
                {
-                       return AddToContainer (symbol, symbol.Name);
+                       return AddToContainer (symbol, symbol.MemberName.MethodName);
                }
 
                protected virtual bool AddToTypeContainer (DeclSpace ds)
@@ -550,6 +550,22 @@ namespace Mono.CSharp {
                                methods.Add (method);
                }
 
+               //
+               // Do not use this method: use AddMethod.
+               //
+               // This is only used by iterators.
+               //
+               public void AppendMethod (Method method)
+               {
+                       if (!AddToMemberContainer (method))
+                               return;
+
+                       if (methods == null)
+                               methods = new MethodArrayList (this);
+
+                       methods.Add (method);
+               }
+
                public void AddConstructor (Constructor c)
                {
                        if (c.Name != MemberName.Name) {
@@ -2296,9 +2312,10 @@ namespace Mono.CSharp {
                        if (default_static_constructor != null)
                                default_static_constructor.Emit ();
                        
-                       if (methods != null)
+                       if (methods != null){
                                foreach (Method m in methods)
                                        m.Emit ();
+                       }
 
                        if (operators != null)
                                foreach (Operator o in operators)
@@ -2821,6 +2838,13 @@ namespace Mono.CSharp {
                        else
                                accmods = Modifiers.PRIVATE;
 
+                       // FIXME: remove this nasty fix for bug #77370 when
+                       // we get good AllowModifiersProp implementation.
+                       if ((mod & Modifiers.STATIC) != 0) {
+                               AllowedModifiers |= Modifiers.STATIC;
+                               AllowedModifiers &= ~ (Modifiers.ABSTRACT | Modifiers.SEALED);
+                       }
+
                        this.ModFlags = Modifiers.Check (AllowedModifiers, mod, accmods, Location);
                        this.OriginalModFlags = mod;
                }
@@ -7971,7 +7995,7 @@ namespace Mono.CSharp {
                        RetType = ret_type;
 
                        if (parameters == null)
-                               Parameters = TypeManager.NoTypes;
+                               Parameters = Type.EmptyTypes;
                        else
                                Parameters = parameters;
                }