X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FMicrosoft.CSharp%2FMicrosoft.CSharp.RuntimeBinder%2FCSharpBinaryOperationBinder.cs;h=374eb0d961fed72ceff5c2ef0787de206da91593;hb=b50017eba3a83ecbb495f4c698531696df043b78;hp=72787fa3dc281370d4f4f8c9dad2597ff0eb0be8;hpb=9ea478b7f796f8b3afc461afbe844b232052915c;p=mono.git diff --git a/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpBinaryOperationBinder.cs b/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpBinaryOperationBinder.cs index 72787fa3dc2..374eb0d961f 100644 --- a/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpBinaryOperationBinder.cs +++ b/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpBinaryOperationBinder.cs @@ -130,21 +130,22 @@ namespace Microsoft.CSharp.RuntimeBinder public override DynamicMetaObject FallbackBinaryOperation (DynamicMetaObject target, DynamicMetaObject arg, DynamicMetaObject errorSuggestion) { - var left = CSharpBinder.CreateCompilerExpression (argumentInfo [0], target); - var right = CSharpBinder.CreateCompilerExpression (argumentInfo [1], arg); + var ctx = DynamicContext.Create (); + var left = ctx.CreateCompilerExpression (argumentInfo [0], target); + var right = ctx.CreateCompilerExpression (argumentInfo [1], arg); bool is_compound; var oper = GetOperator (out is_compound); Compiler.Expression expr; if (is_compound) { - var target_expr = CSharpBinder.CreateCompilerExpression (argumentInfo[0], target); + var target_expr = new Compiler.RuntimeValueExpression (target, ctx.ImportType (target.LimitType)); expr = new Compiler.CompoundAssign (oper, target_expr, right, left); } else { - expr = new Compiler.Binary (oper, left, right, Compiler.Location.Null); + expr = new Compiler.Binary (oper, left, right); } - expr = new Compiler.Cast (new Compiler.TypeExpression (TypeImporter.Import (ReturnType), Compiler.Location.Null), expr); + expr = new Compiler.Cast (new Compiler.TypeExpression (ctx.ImportType (ReturnType), Compiler.Location.Null), expr, Compiler.Location.Null); if ((flags & CSharpBinderFlags.CheckedContext) != 0) expr = new Compiler.CheckedExpr (expr, Compiler.Location.Null); @@ -153,7 +154,7 @@ namespace Microsoft.CSharp.RuntimeBinder binder.AddRestrictions (target); binder.AddRestrictions (arg); - return binder.Bind (context); + return binder.Bind (ctx, context); } } }