Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ValidateAccessorArgumentTypes()

static void System.Linq.Expressions.Expression< TDelegate >.ValidateAccessorArgumentTypes ( MethodInfo method,
ParameterInfo[] indexes,
ref ReadOnlyCollection< Expression< TDelegate > > arguments,
string paramName )
inlinestaticprivateinherited

Definition at line 3047 of file Expression.cs.

3048 {
3049 if (indexes.Length != 0)
3050 {
3051 if (indexes.Length != arguments.Count)
3052 {
3053 throw Error.IncorrectNumberOfMethodCallArguments(method, paramName);
3054 }
3055 Expression[] array = null;
3056 int i = 0;
3057 for (int num = indexes.Length; i < num; i++)
3058 {
3061 ExpressionUtils.RequiresCanRead(argument, "arguments", i);
3062 Type parameterType = parameterInfo.ParameterType;
3063 if (parameterType.IsByRef)
3064 {
3065 throw Error.AccessorsCannotHaveByRefArgs("indexes", i);
3066 }
3067 TypeUtils.ValidateType(parameterType, "indexes", i);
3069 {
3070 throw Error.ExpressionTypeDoesNotMatchMethodParameter(argument.Type, parameterType, method, "arguments", i);
3071 }
3072 if (array == null && argument != arguments[i])
3073 {
3075 for (int j = 0; j < i; j++)
3076 {
3077 array[j] = arguments[j];
3078 }
3079 }
3080 if (array != null)
3081 {
3082 array[i] = argument;
3083 }
3084 }
3085 if (array != null)
3086 {
3088 }
3089 }
3090 else if (arguments.Count > 0)
3091 {
3092 throw Error.IncorrectNumberOfMethodCallArguments(method, paramName);
3093 }
3094 }
static void RequiresCanRead(Expression expression, string paramName)
static void ValidateType(Type type, string paramName)
Definition TypeUtils.cs:695
static bool AreReferenceAssignable(Type dest, Type src)
Definition TypeUtils.cs:673
static bool TryQuote(Type parameterType, ref Expression argument)

References System.Linq.Expressions.Error.AccessorsCannotHaveByRefArgs(), System.Dynamic.Utils.TypeUtils.AreReferenceAssignable(), System.array, System.Collections.Generic.Dictionary< TKey, TValue >.Count, System.Linq.Expressions.Error.ExpressionTypeDoesNotMatchMethodParameter(), System.Linq.Expressions.Error.IncorrectNumberOfMethodCallArguments(), System.Dynamic.Utils.ExpressionUtils.RequiresCanRead(), System.Linq.Expressions.Expression< TDelegate >.TryQuote(), and System.Dynamic.Utils.TypeUtils.ValidateType().

Referenced by System.Linq.Expressions.Expression< TDelegate >.ValidateAccessor().