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

◆ ModuloAssign() [3/3]

static BinaryExpression System.Linq.Expressions.Expression< TDelegate >.ModuloAssign ( Expression< TDelegate > left,
Expression< TDelegate > right,
MethodInfo? method,
LambdaExpression< TDelegate >? conversion )
inlinestaticinherited

Definition at line 1627 of file Expression.cs.

1628 {
1629 ExpressionUtils.RequiresCanRead(left, "left");
1630 RequiresCanWrite(left, "left");
1631 ExpressionUtils.RequiresCanRead(right, "right");
1632 if (method == null)
1633 {
1634 if (left.Type == right.Type && left.Type.IsArithmetic())
1635 {
1636 if (conversion != null)
1637 {
1638 throw Error.ConversionIsNotSupportedForArithmeticTypes();
1639 }
1640 return new SimpleBinaryExpression(ExpressionType.ModuloAssign, left, right, left.Type);
1641 }
1642 return GetUserDefinedAssignOperatorOrThrow(ExpressionType.ModuloAssign, "op_Modulus", left, right, conversion, liftToNull: true);
1643 }
1644 return GetMethodBasedAssignOperator(ExpressionType.ModuloAssign, left, right, method, conversion, liftToNull: true);
1645 }
static void RequiresCanRead(Expression expression, string paramName)
static BinaryExpression GetUserDefinedAssignOperatorOrThrow(ExpressionType binaryType, string name, Expression left, Expression right, LambdaExpression conversion, bool liftToNull)
static void RequiresCanWrite(Expression expression, string paramName)
static BinaryExpression GetMethodBasedAssignOperator(ExpressionType binaryType, Expression left, Expression right, MethodInfo method, LambdaExpression conversion, bool liftToNull)

References System.Linq.Expressions.Error.ConversionIsNotSupportedForArithmeticTypes(), System.Linq.Expressions.Expression< TDelegate >.GetMethodBasedAssignOperator(), System.Linq.Expressions.Expression< TDelegate >.GetUserDefinedAssignOperatorOrThrow(), System.Dynamic.Utils.ExpressionUtils.RequiresCanRead(), and System.Linq.Expressions.Expression< TDelegate >.RequiresCanWrite().