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

◆ AddChecked() [2/2]

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

Definition at line 1432 of file Expression.cs.

1433 {
1434 ExpressionUtils.RequiresCanRead(left, "left");
1435 ExpressionUtils.RequiresCanRead(right, "right");
1436 if (method == null)
1437 {
1438 if (left.Type == right.Type && left.Type.IsArithmetic())
1439 {
1440 return new SimpleBinaryExpression(ExpressionType.AddChecked, left, right, left.Type);
1441 }
1442 return GetUserDefinedBinaryOperatorOrThrow(ExpressionType.AddChecked, "op_Addition", left, right, liftToNull: true);
1443 }
1444 return GetMethodBasedBinaryOperator(ExpressionType.AddChecked, left, right, method, liftToNull: true);
1445 }
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().