Author: miguel
Date: 2007-03-29 10:05:13 -0500 (Thu, 29 Mar 2007)
New Revision: 75146
Modified:
trunk/mcs/class/System.Core/ChangeLog
trunk/mcs/class/System.Core/System.Linq.Expressions/Expression.cs
trunk/mcs/class/System.Core/System.Linq.Expressions/ExpressionType.cs
trunk/mcs/class/System.Core/System.Linq.Expressions/ExpressionUtil.cs
trunk/mcs/class/System.Core/System.Linq.Expressions/FuncletExpression.cs
trunk/mcs/class/System.Core/System.Linq.Expressions/InvocationExpression.cs
trunk/mcs/class/System.Core/System.Linq.Expressions/ParameterExpression.cs
trunk/mcs/class/System.Core/System.Linq/Enumerable.cs
Log:
2007-03-29 Miguel de Icaza <[EMAIL PROTECTED]>
* Reapply the patch from Antonello, and rework the code to not use
extension methods on Enumerable.
Modified: trunk/mcs/class/System.Core/ChangeLog
===================================================================
--- trunk/mcs/class/System.Core/ChangeLog 2007-03-29 14:55:30 UTC (rev
75145)
+++ trunk/mcs/class/System.Core/ChangeLog 2007-03-29 15:05:13 UTC (rev
75146)
@@ -1,3 +1,8 @@
+2007-03-29 Miguel de Icaza <[EMAIL PROTECTED]>
+
+ * Reapply the patch from Antonello, and rework the code to not use
+ extension methods on Enumerable.
+
2007-02-04 Marek Safar <[EMAIL PROTECTED]>
* System.Core.dll.sources: Added common constants.
Modified: trunk/mcs/class/System.Core/System.Linq/Enumerable.cs
===================================================================
--- trunk/mcs/class/System.Core/System.Linq/Enumerable.cs 2007-03-29
14:55:30 UTC (rev 75145)
+++ trunk/mcs/class/System.Core/System.Linq/Enumerable.cs 2007-03-29
15:05:13 UTC (rev 75146)
@@ -2835,7 +2835,7 @@
#endregion
#region ToReadOnlyCollection
- internal static ReadOnlyCollection<TSource>
ToReadOnlyCollection<TSource>(this IEnumerable<TSource> source)
+ internal static ReadOnlyCollection<TSource>
ToReadOnlyCollection<TSource>(IEnumerable<TSource> source)
{
if (source == null)
return new ReadOnlyCollection<TSource>(new List<TSource>());
Modified: trunk/mcs/class/System.Core/System.Linq.Expressions/Expression.cs
===================================================================
--- trunk/mcs/class/System.Core/System.Linq.Expressions/Expression.cs
2007-03-29 14:55:30 UTC (rev 75145)
+++ trunk/mcs/class/System.Core/System.Linq.Expressions/Expression.cs
2007-03-29 15:05:13 UTC (rev 75146)
@@ -139,138 +139,6 @@
return Add(left, right, null);
}
- public static BinaryExpression AddChecked(Expression left, Expression
right, MethodInfo method)
- {
- throw new NotImplementedException();
- }
-
- public static BinaryExpression AddChecked(Expression left, Expression
right)
- {
- throw new NotImplementedException();
- }
-
- public static BinaryExpression And(Expression left, Expression right,
MethodInfo method)
- {
- CheckLeftRight(left, right);
-
- throw new NotImplementedException();
- }
-
- public static BinaryExpression And(Expression left, Expression right)
- {
- return And(left, right, null);
- }
-
- public static BinaryExpression AndAlso(Expression left, Expression
right, MethodInfo method)
- {
- throw new NotImplementedException();
- }
-
- public static BinaryExpression AndAlso(Expression left, Expression
right)
- {
- return AndAlso(left, right, null);
- }
-
- public static MethodCallExpression ArrayIndex(Expression array,
IEnumerable<Expression> indexes)
- {
- throw new NotImplementedException();
- }
-
- public static BinaryExpression ArrayIndex(Expression array, Expression
index)
- {
- throw new NotImplementedException();
- }
-
- public static MethodCallExpression ArrayIndex(Expression array, params
Expression[] indexes)
- {
- throw new NotImplementedException();
- }
-
- public static UnaryExpression ArrayLength(Expression array)
- {
- throw new NotImplementedException();
- }
-
- public static MemberAssignment Bind(MemberInfo member, Expression
expression)
- {
- throw new NotImplementedException();
- }
-
- public static MemberAssignment Bind(MethodInfo propertyAccessor,
Expression expression)
- {
- throw new NotImplementedException();
- }
-
- public static MethodCallExpression Call(Expression instance,
MethodInfo method)
- {
- throw new NotImplementedException();
- }
-
- public static MethodCallExpression Call(MethodInfo method, params
Expression[] arguments)
- {
- throw new NotImplementedException();
- }
-
- public static MethodCallExpression Call(Expression instance,
MethodInfo method, params Expression[] arguments)
- {
- throw new NotImplementedException();
- }
-
- public static MethodCallExpression Call(Expression instance,
MethodInfo method, IEnumerable<Expression> arguments)
- {
- throw new NotImplementedException();
- }
-
- public static MethodCallExpression Call(Expression instance, string
methodName, Type[] typeArguments, params Expression[] arguments)
- {
- throw new NotImplementedException();
- }
-
- public static MethodCallExpression Call(Type type, string methodName,
Type[] typeArguments, params Expression[] arguments)
- {
- throw new NotImplementedException();
- }
-
- public static MethodCallExpression CallVirtual(Expression instance,
MethodInfo method)
- {
- throw new NotImplementedException();
- }
-
- public static MethodCallExpression CallVirtual(Expression instance,
MethodInfo method, params Expression[] arguments)
- {
- throw new NotImplementedException();
- }
-
- public static MethodCallExpression CallVirtual(Expression instance,
MethodInfo method, IEnumerable<Expression> arguments)
- {
- throw new NotImplementedException();
- }
-
- public static UnaryExpression Cast(Expression expression, Type type)
- {
- throw new NotImplementedException();
- }
-
- public static UnaryExpression Cast(Expression expression, Type type,
MethodInfo method)
- {
- throw new NotImplementedException();
- }
-
- public static BinaryExpression Coalesce(Expression left, Expression
right)
- {
- throw new NotImplementedException();
- }
-
- public static BinaryExpression Coalesce(Expression left, Expression
right, MethodInfo conversion)
- {
- throw new NotImplementedException();
- }
-
- public static ConditionalExpression Condition(Expression test,
Expression ifTrue, Expression ifFalse)
- {
- throw new NotImplementedException();
- }
-
public static ConstantExpression Constant(object value)
{
Type valueType = null;
@@ -289,58 +157,6 @@
return new ConstantExpression(value, type);
}
- public static UnaryExpression Convert(Expression expression, Type type)
- {
- throw new NotImplementedException();
- }
-
- public static UnaryExpression Convert(Expression expression, Type
type, MethodInfo method)
- {
- throw new NotImplementedException();
- }
-
- public static UnaryExpression ConvertChecked(Expression expression,
Type type)
- {
- throw new NotImplementedException();
- }
-
- public static UnaryExpression ConvertChecked(Expression expression,
Type type, MethodInfo method)
- {
- throw new NotImplementedException();
- }
-
- public static BinaryExpression Divide(Expression left, Expression
right)
- {
- return Divide(left, right);
- }
-
- public static BinaryExpression Divide(Expression left, Expression
right, MethodInfo method)
- {
- CheckLeftRight(left, right);
-
- throw new NotImplementedException();
- }
-
- public static BinaryExpression Equal(Expression left, Expression right)
- {
- throw new NotImplementedException();
- }
-
- public static BinaryExpression Equal(Expression left, Expression
right, bool liftToNull, MethodInfo method)
- {
- throw new NotImplementedException();
- }
-
- public static BinaryExpression ExclusiveOr(Expression left, Expression
right)
- {
- throw new NotImplementedException();
- }
-
- public static BinaryExpression ExclusiveOr(Expression left, Expression
right, MethodInfo method)
- {
- throw new NotImplementedException();
- }
-
public static MemberExpression Field(Expression expression, FieldInfo
field)
{
if (field == null)
@@ -381,153 +197,23 @@
return typeof(Func<,,,,>).MakeGenericType(typeArgs);
}
- public static BinaryExpression GreaterThan(Expression left, Expression
right)
+ internal static ReadOnlyCollection<TSource>
ToReadOnlyCollection<TSource>(IEnumerable<TSource> source)
{
- throw new NotImplementedException();
- }
+ if (source == null)
+ return new ReadOnlyCollection<TSource>(new List<TSource>());
- public static BinaryExpression GreaterThan(Expression left, Expression
right, bool liftToNull, MethodInfo method)
- {
- throw new NotImplementedException();
- }
+ if (typeof(ReadOnlyCollection<TSource>).IsInstanceOfType(source))
+ return source as ReadOnlyCollection<TSource>;
- public static BinaryExpression GreaterThanOrEqual(Expression left,
Expression right)
- {
- throw new NotImplementedException();
+ return new
ReadOnlyCollection<TSource>(System.Linq.Enumerable.ToArray<TSource>(source));
}
- public static BinaryExpression GreaterThanOrEqual(Expression left,
Expression right, bool liftToNull, MethodInfo method)
- {
- throw new NotImplementedException();
- }
-
- public static InvocationExpression Invoke(Expression expression,
IEnumerable<Expression> arguments)
- {
- throw new NotImplementedException();
- }
-
- public static InvocationExpression Invoke(Expression expression,
params Expression[] arguments)
- {
- throw new NotImplementedException();
- }
-
- public static Expression<TDelegate> Lambda<TDelegate>(Expression body,
params ParameterExpression[] parameters)
- {
- throw new NotImplementedException();
- }
-
- public static Expression<TDelegate> Lambda<TDelegate>(Expression body,
IEnumerable<ParameterExpression> parameters)
- {
- throw new NotImplementedException();
- }
-
- public static LambdaExpression Lambda(Expression body, params
ParameterExpression[] parameters)
- {
- throw new NotImplementedException();
- }
-
- public static LambdaExpression Lambda(Type delegateType, Expression
body, params ParameterExpression[] parameters)
- {
- throw new NotImplementedException();
- }
-
- public static LambdaExpression Lambda(Type delegateType, Expression
body, IEnumerable<ParameterExpression> parameters)
- {
- throw new NotImplementedException();
- }
-
- public static BinaryExpression LeftShift(Expression left, Expression
right)
- {
- throw new NotImplementedException();
- }
-
- public static BinaryExpression LeftShift(Expression left, Expression
right, MethodInfo method)
- {
- throw new NotImplementedException();
- }
-
- public static BinaryExpression LessThan(Expression left, Expression
right)
- {
- throw new NotImplementedException();
- }
-
- public static BinaryExpression LessThan(Expression left, Expression
right, bool liftToNull, MethodInfo method)
- {
- throw new NotImplementedException();
- }
-
- public static BinaryExpression LessThanOrEqual(Expression left,
Expression right)
- {
- throw new NotImplementedException();
- }
-
- public static BinaryExpression LessThanOrEqual(Expression left,
Expression right, bool liftToNull, MethodInfo method)
- {
- throw new NotImplementedException();
- }
-
-/*
- public static LiftExpression Lift(Expression expression,
IEnumerable<ParameterExpression> parameters, IEnumerable<Expression> arguments)
- {
- throw new NotImplementedException();
- }
-
- public static LiftExpression Lift(Expression expression,
ParameterExpression parameter, Expression argument)
- {
- throw new NotImplementedException();
- }
-
- public static LiftExpression LiftEqual(Expression expression,
IEnumerable<ParameterExpression> parameters, IEnumerable<Expression> arguments)
- {
- throw new NotImplementedException();
- }
-
- public static LiftExpression LiftFalse(Expression expression,
IEnumerable<ParameterExpression> parameters, IEnumerable<Expression> arguments)
- {
- throw new NotImplementedException();
- }
-
- public static LiftExpression LiftFalse(Expression expression,
ParameterExpression parameter, Expression argument)
- {
- throw new NotImplementedException();
- }
-
- public static LiftExpression LiftNotEqual(Expression expression,
IEnumerable<ParameterExpression> parameters, IEnumerable<Expression> arguments)
- {
- throw new NotImplementedException();
- }
-
- public static LiftExpression LiftTrue(Expression expression,
IEnumerable<ParameterExpression> parameters, IEnumerable<Expression> arguments)
- {
- throw new NotImplementedException();
- }
-
- public static LiftExpression LiftTrue(Expression expression,
ParameterExpression parameter, Expression argument)
- {
- throw new NotImplementedException();
- }
-*/
- public static MemberListBinding ListBind(MemberInfo member, params
Expression[] initializers)
- {
- throw new NotImplementedException();
- }
-
- public static MemberListBinding ListBind(MemberInfo member,
IEnumerable<Expression> initializers)
- {
- throw new NotImplementedException();
- }
-
- public static MemberListBinding ListBind(MethodInfo propertyAccessor,
IEnumerable<Expression> initializers)
- {
- throw new NotImplementedException();
- }
-
public static ListInitExpression ListInit(NewExpression newExpression,
params Expression[] initializers)
{
if (initializers == null)
throw new ArgumentNullException("inizializers");
- return ListInit(newExpression,
ExpressionUtil.GetReadOnlyCollection (initializers));
+ return ListInit(newExpression,
ToReadOnlyCollection<Expression>(initializers));
}
public static ListInitExpression ListInit(NewExpression newExpression,
IEnumerable<Expression> initializers)
@@ -537,7 +223,7 @@
if (initializers == null)
throw new ArgumentNullException("inizializers");
- return new ListInitExpression(newExpression,
ExpressionUtil.GetReadOnlyCollection(initializers));
+ return new ListInitExpression(newExpression,
ToReadOnlyCollection<Expression>(initializers));
}
public static MemberInitExpression MemberInit(NewExpression
newExpression, IEnumerable<MemberBinding> bindings)
@@ -548,7 +234,7 @@
if (bindings == null)
throw new ArgumentNullException("bindings");
- return new MemberInitExpression(newExpression,
ExpressionUtil.GetReadOnlyCollection(bindings));
+ return new MemberInitExpression(newExpression,
ToReadOnlyCollection<MemberBinding>(bindings));
}
public static MemberExpression Property(Expression expression,
PropertyInfo property)
@@ -626,4 +312,4 @@
}
#endregion
}
-}
\ No newline at end of file
+}
Modified: trunk/mcs/class/System.Core/System.Linq.Expressions/ExpressionType.cs
===================================================================
--- trunk/mcs/class/System.Core/System.Linq.Expressions/ExpressionType.cs
2007-03-29 14:55:30 UTC (rev 75145)
+++ trunk/mcs/class/System.Core/System.Linq.Expressions/ExpressionType.cs
2007-03-29 15:05:13 UTC (rev 75146)
@@ -21,59 +21,59 @@
//
namespace System.Linq.Expressions {
- public enum ExpressionType
- {
- Add,
- AddChecked,
- And,
- AndAlso,
- ArrayLength,
- ArrayIndex,
- Call,
- CallVirtual,
- Cast,
- Coalesce,
- Conditional,
- Constant,
- Convert,
- ConvertChecked,
- Divide,
- Equal,
- ExclusiveOr,
- Funclet,
- GreaterThan,
- GreaterThanOrEqual,
- Invoke,
- Lambda,
- LeftShift,
- LessThan,
- LessThanOrEqual,
- Lift,
- LiftEqual,
- LiftFalse,
- LiftNotEqual,
- LiftTrue,
- ListInit,
- MemberAccess,
- MemberInit,
- Modulo,
- Multiply,
- MultiplyChecked,
- Negate,
- NegateChecked,
- New,
- NewArrayInit,
- NewArrayBounds,
- Not,
- NotEqual,
- Or,
- OrElse,
- Parameter,
- Quote,
- RightShift,
- Subtract,
- SubtractChecked,
- TypeAs,
- TypeIs
+ public enum ExpressionType {
+ Add,
+ AddChecked,
+ And,
+ AndAlso,
+ ArrayIndex,
+ ArrayLength,
+ Call,
+ CallVirtual,
+ Cast,
+ Coalesce,
+ Conditional,
+ Constant,
+ Convert,
+ ConvertChecked,
+ Divide,
+ Equal,
+ ExclusiveOr,
+ Funclet,
+ GreaterThan,
+ GreaterThanOrEqual,
+ Invoke,
+ Lambda,
+ LeftShift,
+ LessThan,
+ LessThanOrEqual,
+ Lift,
+ LiftEqual,
+ LiftFalse,
+ LiftNotEqual,
+ LiftTrue,
+ ListInit,
+ MemberAccess,
+ MemberInit,
+ Modulo,
+ Multiply,
+ MultiplyChecked,
+ Negate,
+ NegateChecked,
+ New,
+ NewArrayBounds,
+ NewArrayInit,
+ Not,
+ NotEqual,
+ Or,
+ OrElse,
+ Parameter,
+ Quote,
+ RightShift,
+ Subtract,
+ SubtractChecked,
+ TypeAs,
+ TypeIs
+
}
}
Modified: trunk/mcs/class/System.Core/System.Linq.Expressions/ExpressionUtil.cs
===================================================================
--- trunk/mcs/class/System.Core/System.Linq.Expressions/ExpressionUtil.cs
2007-03-29 14:55:30 UTC (rev 75145)
+++ trunk/mcs/class/System.Core/System.Linq.Expressions/ExpressionUtil.cs
2007-03-29 15:05:13 UTC (rev 75146)
@@ -55,23 +55,5 @@
return method;
}
-
- public static ReadOnlyCollection<MemberBinding>
GetReadOnlyCollection(IEnumerable<MemberBinding> en)
- {
- if (en == null)
- return new ReadOnlyCollection<MemberBinding>(new
MemberBinding[0]);
-
- List<MemberBinding> list = new List<MemberBinding>(en);
- return new ReadOnlyCollection<MemberBinding>(list);
- }
-
- public static ReadOnlyCollection<Expression>
GetReadOnlyCollection(IEnumerable<Expression> en)
- {
- if (en == null)
- return new ReadOnlyCollection<Expression>(new Expression[0]);
-
- List<Expression> list = new List<Expression>(en);
- return new ReadOnlyCollection<Expression>(list);
- }
}
}
Modified:
trunk/mcs/class/System.Core/System.Linq.Expressions/FuncletExpression.cs
===================================================================
--- trunk/mcs/class/System.Core/System.Linq.Expressions/FuncletExpression.cs
2007-03-29 14:55:30 UTC (rev 75145)
+++ trunk/mcs/class/System.Core/System.Linq.Expressions/FuncletExpression.cs
2007-03-29 15:05:13 UTC (rev 75146)
@@ -17,7 +17,7 @@
#endregion
#region Properties
- public Funclet Funclet
+ public new Funclet Funclet
{
get { return funclet; }
}
Modified:
trunk/mcs/class/System.Core/System.Linq.Expressions/InvocationExpression.cs
===================================================================
--- trunk/mcs/class/System.Core/System.Linq.Expressions/InvocationExpression.cs
2007-03-29 14:55:30 UTC (rev 75145)
+++ trunk/mcs/class/System.Core/System.Linq.Expressions/InvocationExpression.cs
2007-03-29 15:05:13 UTC (rev 75146)
@@ -25,7 +25,7 @@
get { return arguments; }
}
- public Expression Expression
+ public new Expression Lambda
{
get { return lambda; }
}
Modified:
trunk/mcs/class/System.Core/System.Linq.Expressions/ParameterExpression.cs
===================================================================
--- trunk/mcs/class/System.Core/System.Linq.Expressions/ParameterExpression.cs
2007-03-29 14:55:30 UTC (rev 75145)
+++ trunk/mcs/class/System.Core/System.Linq.Expressions/ParameterExpression.cs
2007-03-29 15:05:13 UTC (rev 75146)
@@ -26,7 +26,7 @@
namespace System.Linq.Expressions
{
- public sealed class ParameterExpression : Expression
+ public class ParameterExpression : Expression
{
#region .ctor
internal ParameterExpression(Type type, string name)
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches