Author: jbevain
Date: 2008-02-04 10:17:44 -0500 (Mon, 04 Feb 2008)
New Revision: 94751
Modified:
trunk/mcs/class/System.Core/System.Linq.Expressions/ChangeLog
trunk/mcs/class/System.Core/System.Linq.Expressions/Expression.cs
trunk/mcs/class/System.Core/System.Linq.Expressions/NewExpression.cs
Log:
2008-02-04 Jb Evain <[EMAIL PROTECTED]>
* Expression.cs, NewExpression.cs: make New(Type) test pass.
Modified: trunk/mcs/class/System.Core/System.Linq.Expressions/ChangeLog
===================================================================
--- trunk/mcs/class/System.Core/System.Linq.Expressions/ChangeLog
2008-02-04 15:15:16 UTC (rev 94750)
+++ trunk/mcs/class/System.Core/System.Linq.Expressions/ChangeLog
2008-02-04 15:17:44 UTC (rev 94751)
@@ -1,5 +1,9 @@
2008-02-04 Jb Evain <[EMAIL PROTECTED]>
+ * Expression.cs, NewExpression.cs: make New(Type) test pass.
+
+2008-02-04 Jb Evain <[EMAIL PROTECTED]>
+
* ExpressionPrinter.cs: fix and clean printing of ElementInit.
2008-02-02 Jb Evain <[EMAIL PROTECTED]>
Modified: trunk/mcs/class/System.Core/System.Linq.Expressions/Expression.cs
===================================================================
--- trunk/mcs/class/System.Core/System.Linq.Expressions/Expression.cs
2008-02-04 15:15:16 UTC (rev 94750)
+++ trunk/mcs/class/System.Core/System.Linq.Expressions/Expression.cs
2008-02-04 15:17:44 UTC (rev 94751)
@@ -1439,7 +1439,7 @@
if (constructor.GetParameters ().Length > 0)
throw new ArgumentException ("Constructor must
be parameter less");
- return new NewExpression (constructor, (null as
IEnumerable<Expression>).ToReadOnlyCollection<Expression> (), null);
+ return new NewExpression (constructor, (null as
IEnumerable<Expression>).ToReadOnlyCollection (), null);
}
public static NewExpression New (Type type)
@@ -1447,10 +1447,11 @@
if (type == null)
throw new ArgumentNullException ("type");
- if (type.GetConstructor (Type.EmptyTypes) == null)
+ var ctor = type.GetConstructor (Type.EmptyTypes);
+ if (ctor == null)
throw new ArgumentException ("Type doesn't have
a parameter less constructor");
- return new NewExpression (type, (null as
IEnumerable<Expression>).ToReadOnlyCollection<Expression> ());
+ return new NewExpression (ctor, (null as
IEnumerable<Expression>).ToReadOnlyCollection (), null);
}
public static NewExpression New (ConstructorInfo constructor,
params Expression [] arguments)
Modified: trunk/mcs/class/System.Core/System.Linq.Expressions/NewExpression.cs
===================================================================
--- trunk/mcs/class/System.Core/System.Linq.Expressions/NewExpression.cs
2008-02-04 15:15:16 UTC (rev 94750)
+++ trunk/mcs/class/System.Core/System.Linq.Expressions/NewExpression.cs
2008-02-04 15:17:44 UTC (rev 94751)
@@ -51,12 +51,6 @@
get { return members; }
}
- internal NewExpression (Type type,
ReadOnlyCollection<Expression> arguments)
- : base (ExpressionType.New, type)
- {
- this.arguments = arguments;
- }
-
internal NewExpression (ConstructorInfo constructor,
ReadOnlyCollection<Expression> arguments, ReadOnlyCollection<MemberInfo>
members)
: base (ExpressionType.New, constructor.DeclaringType)
{
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches