* TabControl.cs: Fix typo, emilinates an unneeded expose event.
[mono.git] / mcs / mcs / anonymous.cs
index fed2c34b1e3b97c6ca001ec29bdeb002b49277c4..dfadc80316048ef5aa71905306ab23f224369c68 100644 (file)
@@ -52,7 +52,7 @@ namespace Mono.CSharp {
                //
                // The modifiers applied to the method, we aggregate them
                //
-               int method_modifiers = Modifiers.INTERNAL;
+               int method_modifiers = Modifiers.PRIVATE;
                
                //
                // During the resolve stage of the anonymous method body,
@@ -169,7 +169,6 @@ namespace Mono.CSharp {
 
                        if (Parameters == null){
                                int i, j;
-                               out_invalid_check = true;
                                
                                //
                                // We provide a set of inaccessible parameters
@@ -290,10 +289,10 @@ namespace Mono.CSharp {
                        return method.MethodData.MethodBuilder;
                }
                
-               public void EmitMethod (EmitContext ec)
+               public bool EmitMethod (EmitContext ec)
                {
                        if (!CreateMethodHost (ec, invoke_mb.ReturnType))
-                               return;
+                               return false;
 
                        MethodBuilder builder = GetMethodBuilder ();
                        ILGenerator ig = builder.GetILGenerator ();
@@ -309,6 +308,7 @@ namespace Mono.CSharp {
                        
                        aec.EmitMeta (Block, amp);
                        aec.EmitResolvedTopBlock (Block, unreachable);
+                       return true;
                }
 
                public static void Error_AddressOfCapturedVar (string name, Location loc)
@@ -334,12 +334,14 @@ namespace Mono.CSharp {
                public override Expression DoResolve (EmitContext ec)
                {
                        eclass = ExprClass.Value;
+
                        return this;
                }
                
                public override void Emit (EmitContext ec)
                {
-                       am.EmitMethod (ec);
+                       if (!am.EmitMethod (ec))
+                               return;
 
                        //
                        // Now emit the delegate creation.