internal override Expression ToExpression(MethodBinderContext context, Expression[] parameters) { object val = _defaultValue; if (val is Missing) { val = CompilerHelpers.GetMissingValue(_argumentType); } #if FULL if (_argumentType.IsByRef) { Variable tmp = context.GetTemporary(_argumentType.GetElementType(), "optRef"); return(Ast.Comma( Ast.Assign( tmp, Ast.Convert(Ast.Constant(val), tmp.Type) ), Ast.Read(tmp) )); } #endif return(context.ConvertExpression(Ast.Constant(val), _argumentType)); }
internal override Expression ToExpression(MethodBinderContext context, Expression[] parameters) { Expression[] elems = new Expression[_count]; for (int i = 0; i < _count; i++) { elems[i] = context.ConvertExpression(parameters[_start + i], _elementType); } return(Ast.NewArray(_elementType.MakeArrayType(), elems)); }
internal override Expression ToExpression(MethodBinderContext context, Expression[] parameters) { object val = _defaultValue; if (val is Missing) { val = CompilerHelpers.GetMissingValue(_argumentType); } return(context.ConvertExpression(Ast.Constant(val), _argumentType)); }
internal override Expression ToExpression(MethodBinderContext context, Expression[] parameters) { Debug.Assert(_index < parameters.Length); Debug.Assert(parameters[_index] != null); return context.ConvertExpression(parameters[_index], _parameterType); }
internal override Expression ToExpression(MethodBinderContext context, Expression[] parameters) { Debug.Assert(_index < parameters.Length); Debug.Assert(parameters[_index] != null); return(context.ConvertExpression(parameters[_index], _parameterType)); }
internal override Expression ToExpression(MethodBinderContext context, Expression[] parameters) { object val = _defaultValue; if(val is Missing) { val = CompilerHelpers.GetMissingValue(_argumentType); } #if FULL if (_argumentType.IsByRef) { Variable tmp = context.GetTemporary(_argumentType.GetElementType(), "optRef"); return Ast.Comma( Ast.Assign( tmp, Ast.Convert(Ast.Constant(val), tmp.Type) ), Ast.Read(tmp) ); } #endif return context.ConvertExpression(Ast.Constant(val), _argumentType); }
internal override Expression ToExpression(MethodBinderContext context, Expression[] parameters) { object val = _defaultValue; if(val is Missing) { val = CompilerHelpers.GetMissingValue(_argumentType); } return context.ConvertExpression(Ast.Constant(val), _argumentType); }