/// <summary> /// Gets expressions to access all the arguments. This includes the instance argument. /// </summary> private Expression[] MakeArgumentExpressions() { if (_instance == null) { return(MetaObject.GetExpressions(_args)); } Expression[] res = new Expression[_args.Length + 1]; res[0] = _instance; for (int i = 0; i < _args.Length; i++) { res[i + 1] = _args[i].Expression; } return(res); }
private static MetaObject MakeOperatorError(OperatorInfo info, MetaObject[] args) { return(new MetaObject( Ast.Throw( AstUtils.ComplexCallHelper( typeof(BinderOps).GetMethod("BadArgumentsForOperation"), ArrayUtils.Insert((Expression)Ast.Constant(info.Operator), MetaObject.GetExpressions(args)) ) ), Restrictions.Combine(args) )); }