2010-01-08 Jb Evain <jbevain@novell.com>
authorJb Evain <jbevain@gmail.com>
Fri, 8 Jan 2010 13:59:20 +0000 (13:59 -0000)
committerJb Evain <jbevain@gmail.com>
Fri, 8 Jan 2010 13:59:20 +0000 (13:59 -0000)
* Expression.cs (Call): properly deal with zero length array
of type arguments for non generic methods. Fixes #568989.

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

mcs/class/System.Core/System.Linq.Expressions/ChangeLog
mcs/class/System.Core/System.Linq.Expressions/Expression.cs

index cc36c0253b7e2ee91400e322c025822d3582a6cc..8c1d3dd217ecb4e4fa13474f1fa36f4d88bda6d6 100644 (file)
@@ -1,3 +1,8 @@
+2010-01-08  Jb Evain  <jbevain@novell.com>
+
+       * Expression.cs (Call): properly deal with zero length array
+       of type arguments for non generic methods. Fixes #568989.
+
 2009-12-02 Gonzalo Paniagua Javier <gonzalo@novell.com>
 
        * Expression.cs: expression can be null for static getters. Patch from
index 78ed9ead2e0d0713c2c1fcb03003025bafef0420..b87a634af869c348171f203529453e1663fe8338 100644 (file)
@@ -1043,7 +1043,7 @@ namespace System.Linq.Expressions {
                        if (method == null)
                                return null;
 
-                       if (!method.IsGenericMethod && args == null)
+                       if (!method.IsGenericMethod && (args == null || args.Length == 0))
                                return method;
 
                        if (args.Length == method.GetGenericArguments ().Length)
@@ -2097,7 +2097,7 @@ namespace System.Linq.Expressions {
                                        throw new ArgumentNullException ("expression");
                                if (!expression.Type.IsAssignableTo (propertyAccessor.DeclaringType))
                                        throw new ArgumentException ("expression");
-                       } 
+                       }
                        //
                        // .NET does not mandate that if the property is static, that the expression must be null
                        // fixes a bug exposed by Orchard's ContentItemRecordAlteration.Alteration