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

◆ Modulo() [2/2]

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

Definition at line 1602 of file Expression.cs.

1603 {
1604 ExpressionUtils.RequiresCanRead(left, "left");
1605 ExpressionUtils.RequiresCanRead(right, "right");
1606 if (method == null)
1607 {
1608 if (left.Type == right.Type && left.Type.IsArithmetic())
1609 {
1610 return new SimpleBinaryExpression(ExpressionType.Modulo, left, right, left.Type);
1611 }
1612 return GetUserDefinedBinaryOperatorOrThrow(ExpressionType.Modulo, "op_Modulus", left, right, liftToNull: true);
1613 }
1614 return GetMethodBasedBinaryOperator(ExpressionType.Modulo, left, right, method, liftToNull: true);
1615 }
static void RequiresCanRead(Expression expression, string paramName)
static BinaryExpression GetMethodBasedBinaryOperator(ExpressionType binaryType, Expression left, Expression right, MethodInfo method, bool liftToNull)
static BinaryExpression GetUserDefinedBinaryOperatorOrThrow(ExpressionType binaryType, string name, Expression left, Expression right, bool liftToNull)

References System.Linq.Expressions.Expression< TDelegate >.GetMethodBasedBinaryOperator(), System.Linq.Expressions.Expression< TDelegate >.GetUserDefinedBinaryOperatorOrThrow(), and System.Dynamic.Utils.ExpressionUtils.RequiresCanRead().