public override DynamicMetaObject FallbackSetMember (DynamicMetaObject target, DynamicMetaObject value, DynamicMetaObject errorSuggestion)
		{
			var ctx = DynamicContext.Create ();
			var source = ctx.CreateCompilerExpression (argumentInfo [1], value);
			var expr = ctx.CreateCompilerExpression (argumentInfo [0], target);

			// Field assignment
			expr = new Compiler.MemberAccess (expr, Name);

			// Compound assignment under dynamic context does not convert result
			// expression but when setting member type we need to do explicit
			// conversion to ensure type match between member type and dynamic
			// expression type
			if ((flags & CSharpBinderFlags.ValueFromCompoundAssignment) != 0) {
				expr = new Compiler.RuntimeExplicitAssign (expr, source);
			} else {
				expr = new Compiler.SimpleAssign (expr, source);
			}

			expr = new Compiler.Cast (new Compiler.TypeExpression (ctx.ImportType (ReturnType), Compiler.Location.Null), expr, Compiler.Location.Null);

			var binder = new CSharpBinder (this, expr, errorSuggestion);
			binder.AddRestrictions (target);
			binder.AddRestrictions (value);

			return binder.Bind (ctx, callingContext);
		}
		public override DynamicMetaObject FallbackSetIndex (DynamicMetaObject target, DynamicMetaObject[] indexes, DynamicMetaObject value, DynamicMetaObject errorSuggestion)
		{
			if (argumentInfo.Count != indexes.Length + 2) {
				if (errorSuggestion == null)
					throw new NotImplementedException ();

				return errorSuggestion;
			}

			var ctx = DynamicContext.Create ();
			var expr = ctx.CreateCompilerExpression (argumentInfo [0], target);
			var args = ctx.CreateCompilerArguments (argumentInfo.Skip (1), indexes);
			expr = new Compiler.ElementAccess (expr, args, Compiler.Location.Null);

			var source = ctx.CreateCompilerExpression (argumentInfo [indexes.Length + 1], value);

			// Same conversion as in SetMemberBinder
			if ((flags & CSharpBinderFlags.ValueFromCompoundAssignment) != 0) {
				expr = new Compiler.RuntimeExplicitAssign (expr, source);
			} else {
				expr = new Compiler.SimpleAssign (expr, source);
			}
			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);

			var binder = new CSharpBinder (this, expr, errorSuggestion);
			binder.AddRestrictions (target);
			binder.AddRestrictions (value);
			binder.AddRestrictions (indexes);

			return binder.Bind (ctx, callingContext);
		}
        public override DynamicMetaObject FallbackSetIndex(DynamicMetaObject target, DynamicMetaObject[] indexes, DynamicMetaObject value, DynamicMetaObject errorSuggestion)
        {
            if (argumentInfo.Count != indexes.Length + 2)
            {
                if (errorSuggestion == null)
                {
                    throw new NotImplementedException();
                }

                return(errorSuggestion);
            }

            var ctx  = DynamicContext.Create();
            var expr = ctx.CreateCompilerExpression(argumentInfo [0], target);
            var args = ctx.CreateCompilerArguments(argumentInfo.Skip(1), indexes);

            expr = new Compiler.ElementAccess(expr, args, Compiler.Location.Null);

            var source = ctx.CreateCompilerExpression(argumentInfo [indexes.Length + 1], value);

            // Same conversion as in SetMemberBinder
            if ((flags & CSharpBinderFlags.ValueFromCompoundAssignment) != 0)
            {
                expr = new Compiler.RuntimeExplicitAssign(expr, source);
            }
            else
            {
                expr = new Compiler.SimpleAssign(expr, source);
            }
            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);
            }

            var binder = new CSharpBinder(this, expr, errorSuggestion);

            binder.AddRestrictions(target);
            binder.AddRestrictions(value);
            binder.AddRestrictions(indexes);

            return(binder.Bind(ctx, callingContext));
        }
        public override DynamicMetaObject FallbackSetMember(DynamicMetaObject target, DynamicMetaObject value, DynamicMetaObject errorSuggestion)
        {
            var ctx    = DynamicContext.Create();
            var source = ctx.CreateCompilerExpression(argumentInfo [1], value);
            var expr   = ctx.CreateCompilerExpression(argumentInfo [0], target);

            // Field assignment
            expr = new Compiler.MemberAccess(expr, Name);

            // Compound assignment under dynamic context does not convert result
            // expression but when setting member type we need to do explicit
            // conversion to ensure type match between member type and dynamic
            // expression type
            if ((flags & CSharpBinderFlags.ValueFromCompoundAssignment) != 0)
            {
                expr = new Compiler.RuntimeExplicitAssign(expr, source);
            }
            else
            {
                expr = new Compiler.SimpleAssign(expr, source);
            }

            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);
            }

            var binder = new CSharpBinder(this, expr, errorSuggestion);

            binder.AddRestrictions(target);
            binder.AddRestrictions(value);

            return(binder.Bind(ctx, callingContext));
        }