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

◆ AddAssign() [3/3]

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

Definition at line 1358 of file Expression.cs.

1359 {
1360 ExpressionUtils.RequiresCanRead(left, "left");
1361 RequiresCanWrite(left, "left");
1362 ExpressionUtils.RequiresCanRead(right, "right");
1363 if (method == null)
1364 {
1365 if (left.Type == right.Type && left.Type.IsArithmetic())
1366 {
1367 if (conversion != null)
1368 {
1369 throw Error.ConversionIsNotSupportedForArithmeticTypes();
1370 }
1371 return new SimpleBinaryExpression(ExpressionType.AddAssign, left, right, left.Type);
1372 }
1373 return GetUserDefinedAssignOperatorOrThrow(ExpressionType.AddAssign, "op_Addition", left, right, conversion, liftToNull: true);
1374 }
1376 }
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().