2010-03-30 Jb Evain <jbevain@novell.com>
authorJb Evain <jbevain@gmail.com>
Tue, 30 Mar 2010 13:37:08 +0000 (13:37 -0000)
committerJb Evain <jbevain@gmail.com>
Tue, 30 Mar 2010 13:37:08 +0000 (13:37 -0000)
* Binder.cs (BindToMethod): fix the case where we bind to a method
with only one params parameter and that no args are given.

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

mcs/class/corlib/System.Reflection/Binder.cs
mcs/class/corlib/System.Reflection/ChangeLog

index 80aa2dcee80add4722305be5b0c35611377bcf7f..f4ec51d472f14ec8de71ef97ef0c226e3fe0822b 100644 (file)
@@ -168,12 +168,17 @@ namespace System.Reflection
                                if (names != null)
                                        ReorderParameters (names, ref args, selected);
 
-                               if (selected != null && args != null && args.Length > 0)
+                               if (selected != null) {
+                                       if (args == null)
+                                               args = new object [0];
+       
                                        AdjustArguments (selected, ref args);
+                               }
 
                                return selected;
                        }
 
+                       // probably belongs in ReorderArgumentArray
                        static void AdjustArguments (MethodBase selected, ref object [] args)
                        {
                                var parameters = selected.GetParameters ();
index 9928c191df278ee444ad1984e5ffcc6619ce3f69..0a996bb3671f17a000a066def1e2f53d33749a5f 100644 (file)
@@ -1,3 +1,8 @@
+2010-03-30  Jb Evain  <jbevain@novell.com>
+
+       * Binder.cs (BindToMethod): fix the case where we bind to a method
+       with only one params parameter and that no args are given.
+
 2010-03-30  Jb Evain  <jbevain@novell.com>
 
        * Binder.cs: when invoking a params method, pack the params