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

◆ SubtractChecked() [2/2]

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

Definition at line 1532 of file Expression.cs.

1533 {
1534 ExpressionUtils.RequiresCanRead(left, "left");
1535 ExpressionUtils.RequiresCanRead(right, "right");
1536 if (method == null)
1537 {
1538 if (left.Type == right.Type && left.Type.IsArithmetic())
1539 {
1540 return new SimpleBinaryExpression(ExpressionType.SubtractChecked, left, right, left.Type);
1541 }
1542 return GetUserDefinedBinaryOperatorOrThrow(ExpressionType.SubtractChecked, "op_Subtraction", left, right, liftToNull: true);
1543 }
1544 return GetMethodBasedBinaryOperator(ExpressionType.SubtractChecked, left, right, method, liftToNull: true);
1545 }
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().