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

◆ SubtractAssign() [3/3]

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

Definition at line 1477 of file Expression.cs.

1478 {
1479 ExpressionUtils.RequiresCanRead(left, "left");
1480 RequiresCanWrite(left, "left");
1481 ExpressionUtils.RequiresCanRead(right, "right");
1482 if (method == null)
1483 {
1484 if (left.Type == right.Type && left.Type.IsArithmetic())
1485 {
1486 if (conversion != null)
1487 {
1488 throw Error.ConversionIsNotSupportedForArithmeticTypes();
1489 }
1490 return new SimpleBinaryExpression(ExpressionType.SubtractAssign, left, right, left.Type);
1491 }
1492 return GetUserDefinedAssignOperatorOrThrow(ExpressionType.SubtractAssign, "op_Subtraction", left, right, conversion, liftToNull: true);
1493 }
1494 return GetMethodBasedAssignOperator(ExpressionType.SubtractAssign, left, right, method, conversion, liftToNull: true);
1495 }
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().