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

◆ Subtract() [2/2]

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

Definition at line 1452 of file Expression.cs.

1453 {
1454 ExpressionUtils.RequiresCanRead(left, "left");
1455 ExpressionUtils.RequiresCanRead(right, "right");
1456 if (method == null)
1457 {
1458 if (left.Type == right.Type && left.Type.IsArithmetic())
1459 {
1460 return new SimpleBinaryExpression(ExpressionType.Subtract, left, right, left.Type);
1461 }
1462 return GetUserDefinedBinaryOperatorOrThrow(ExpressionType.Subtract, "op_Subtraction", left, right, liftToNull: true);
1463 }
1464 return GetMethodBasedBinaryOperator(ExpressionType.Subtract, left, right, method, liftToNull: true);
1465 }
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().