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

◆ AddAssignChecked() [3/3]

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

Definition at line 1407 of file Expression.cs.

1408 {
1409 ExpressionUtils.RequiresCanRead(left, "left");
1410 RequiresCanWrite(left, "left");
1411 ExpressionUtils.RequiresCanRead(right, "right");
1412 if (method == null)
1413 {
1414 if (left.Type == right.Type && left.Type.IsArithmetic())
1415 {
1416 if (conversion != null)
1417 {
1418 throw Error.ConversionIsNotSupportedForArithmeticTypes();
1419 }
1420 return new SimpleBinaryExpression(ExpressionType.AddAssignChecked, left, right, left.Type);
1421 }
1422 return GetUserDefinedAssignOperatorOrThrow(ExpressionType.AddAssignChecked, "op_Addition", left, right, conversion, liftToNull: true);
1423 }
1424 return GetMethodBasedAssignOperator(ExpressionType.AddAssignChecked, left, right, method, conversion, liftToNull: true);
1425 }
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().