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

◆ SubtractAssignChecked() [3/3]

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

Definition at line 1507 of file Expression.cs.

1508 {
1509 ExpressionUtils.RequiresCanRead(left, "left");
1510 RequiresCanWrite(left, "left");
1511 ExpressionUtils.RequiresCanRead(right, "right");
1512 if (method == null)
1513 {
1514 if (left.Type == right.Type && left.Type.IsArithmetic())
1515 {
1516 if (conversion != null)
1517 {
1518 throw Error.ConversionIsNotSupportedForArithmeticTypes();
1519 }
1520 return new SimpleBinaryExpression(ExpressionType.SubtractAssignChecked, left, right, left.Type);
1521 }
1522 return GetUserDefinedAssignOperatorOrThrow(ExpressionType.SubtractAssignChecked, "op_Subtraction", left, right, conversion, liftToNull: true);
1523 }
1524 return GetMethodBasedAssignOperator(ExpressionType.SubtractAssignChecked, left, right, method, conversion, liftToNull: true);
1525 }
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().