From 73d31c3d570324297e53fdfecacd0c618e9d6496 Mon Sep 17 00:00:00 2001 From: Jb Evain Date: Sun, 27 Jan 2008 18:15:42 +0000 Subject: [PATCH] 2008-01-27 Jb Evain * LambdaExpression.cs: fix the Type of the LambdaExpressions. svn path=/trunk/mcs/; revision=94067 --- .../System.Core/System.Linq.Expressions/ChangeLog | 4 ++++ .../System.Linq.Expressions/LambdaExpression.cs | 11 +++-------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/mcs/class/System.Core/System.Linq.Expressions/ChangeLog b/mcs/class/System.Core/System.Linq.Expressions/ChangeLog index 71d0b237fa3..524922b512e 100644 --- a/mcs/class/System.Core/System.Linq.Expressions/ChangeLog +++ b/mcs/class/System.Core/System.Linq.Expressions/ChangeLog @@ -1,3 +1,7 @@ +2008-01-27 Jb Evain + + * LambdaExpression.cs: fix the Type of the LambdaExpressions. + 2008-01-27 Olivier Dufour * Expression.cs, InvocationExpession.cs, diff --git a/mcs/class/System.Core/System.Linq.Expressions/LambdaExpression.cs b/mcs/class/System.Core/System.Linq.Expressions/LambdaExpression.cs index a6401c05a3b..8c8007c0a7a 100644 --- a/mcs/class/System.Core/System.Linq.Expressions/LambdaExpression.cs +++ b/mcs/class/System.Core/System.Linq.Expressions/LambdaExpression.cs @@ -72,14 +72,14 @@ namespace System.Linq.Expressions { // https://bugzilla.novell.com/show_bug.cgi?id=355005 // string name = GenName (); - Method = new DynamicMethod (name, Owner.Type, ParamTypes, owner_of_code); + Method = new DynamicMethod (name, Owner.Body.Type, ParamTypes, owner_of_code); ig = Method.GetILGenerator (); } internal Delegate CreateDelegate () { - return Method.CreateDelegate (Owner.DelegateType); + return Method.CreateDelegate (Owner.Type); } internal int GetParameterPosition (ParameterExpression p) @@ -112,10 +112,6 @@ namespace System.Linq.Expressions { get { return parameters; } } - internal Type DelegateType { - get { return delegate_type; } - } - static bool CanAssign (Type target, Type source) { // This catches object and value type mixage, type compatibility is handled later @@ -126,7 +122,7 @@ namespace System.Linq.Expressions { } internal LambdaExpression (Type delegateType, Expression body, ReadOnlyCollection parameters) - : base (ExpressionType.Lambda, body.Type) + : base (ExpressionType.Lambda, delegateType) { if (!delegateType.IsSubclassOf (typeof (System.Delegate))) throw new ArgumentException ("delegateType"); @@ -149,7 +145,6 @@ namespace System.Linq.Expressions { this.body = body; this.parameters = parameters; - delegate_type = delegateType; } internal override void Emit (EmitContext ec) -- 2.25.1