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

◆ NewArrayBounds() [1/2]

static NewArrayExpression System.Linq.Expressions.Expression< TDelegate >.NewArrayBounds ( Type type,
IEnumerable< Expression< TDelegate > > bounds )
inlinestaticinherited

Definition at line 4438 of file Expression.cs.

4439 {
4442 if (type == typeof(void))
4443 {
4444 throw Error.ArgumentCannotBeOfTypeVoid("type");
4445 }
4446 TypeUtils.ValidateType(type, "type");
4449 if (count <= 0)
4450 {
4451 throw Error.BoundsCannotBeLessThanOne("bounds");
4452 }
4453 for (int i = 0; i < count; i++)
4454 {
4457 if (!expression.Type.IsInteger())
4458 {
4459 throw Error.ArgumentMustBeInteger("bounds", i);
4460 }
4461 }
4462 Type type2 = ((count != 1) ? type.MakeArrayType(count) : type.MakeArrayType());
4463 return NewArrayExpression.Make(ExpressionType.NewArrayBounds, type2, readOnlyCollection);
4464 }
static void RequiresNotNull(object value, string paramName)
static void RequiresCanRead(Expression expression, string paramName)
static void ValidateType(Type type, string paramName)
Definition TypeUtils.cs:695

References System.Linq.Expressions.Error.ArgumentCannotBeOfTypeVoid(), System.Linq.Expressions.Error.ArgumentMustBeInteger(), System.Linq.Expressions.Error.BoundsCannotBeLessThanOne(), System.Linq.count, System.Collections.Generic.Dictionary< TKey, TValue >.Count, System.Linq.Expressions.NewArrayExpression.Make(), System.Dynamic.Utils.ExpressionUtils.RequiresCanRead(), System.Dynamic.Utils.ContractUtils.RequiresNotNull(), System.type, and System.Dynamic.Utils.TypeUtils.ValidateType().