2007-08-21 Marek Safar <marek.safar@gmail.com>
authorMarek Safar <marek.safar@gmail.com>
Tue, 21 Aug 2007 11:37:04 +0000 (11:37 -0000)
committerMarek Safar <marek.safar@gmail.com>
Tue, 21 Aug 2007 11:37:04 +0000 (11:37 -0000)
* anonymous.cs (AnonymousMethod): Generate private anonymous method
to fix problem with private arguments.

svn path=/trunk/mcs/; revision=84538

mcs/mcs/ChangeLog
mcs/mcs/anonymous.cs

index ecad2d97ea9b45540d2c363c4fa390483631b677..f744428acf31229b2da0100674146132014c2a90 100644 (file)
@@ -1,3 +1,8 @@
+2007-08-21  Marek Safar  <marek.safar@gmail.com>
+
+       * anonymous.cs (AnonymousMethod): Generate private anonymous method
+       to fix problem with private arguments.
+
 2007-08-20  Marek Safar  <marek.safar@gmail.com>
 
        * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
index 37099cb768053f6b6100702fce762641873ee50f..8fad8bd6b7153f30735b5bd4387969fc39c07fd7 100644 (file)
@@ -1732,7 +1732,7 @@ namespace Mono.CSharp {
 
                        return new AnonymousMethodMethod (
                                this, scope, generic_method, new TypeExpression (ReturnType, Location),
-                               Modifiers.INTERNAL, member_name, Parameters);
+                               Modifiers.PRIVATE, member_name, Parameters);
                }
 
                public override Expression Resolve (EmitContext ec)
@@ -1752,8 +1752,9 @@ namespace Mono.CSharp {
                                        throw new InternalErrorException ();
 
                                MethodGroupExpr mg = (MethodGroupExpr) Expression.MemberLookup (
-                                       ec.ContainerType, scope_type, builder.Name, Location);
-
+                                       ec.ContainerType, scope_type, builder.Name,
+                                       MemberTypes.Method, Expression.AllBindingFlags | BindingFlags.NonPublic, Location);
+                               
                                if (mg == null)
                                        throw new InternalErrorException ();
                                builder = (MethodInfo) mg.Methods [0];