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

◆ MakeOpAssignUnary()

static UnaryExpression System.Linq.Expressions.Expression< TDelegate >.MakeOpAssignUnary ( ExpressionType kind,
Expression< TDelegate > expression,
MethodInfo method )
inlinestaticprivateinherited

Definition at line 5458 of file Expression.cs.

5459 {
5461 RequiresCanWrite(expression, "expression");
5462 UnaryExpression unaryExpression;
5463 if (method == null)
5464 {
5465 if (expression.Type.IsArithmetic())
5466 {
5467 return new UnaryExpression(kind, expression, expression.Type, null);
5468 }
5469 string name = ((kind != ExpressionType.PreIncrementAssign && kind != ExpressionType.PostIncrementAssign) ? "op_Decrement" : "op_Increment");
5471 }
5472 else
5473 {
5475 }
5477 {
5478 throw Error.UserDefinedOpMustHaveValidReturnType(kind, method.Name);
5479 }
5480 return unaryExpression;
5481 }
static void RequiresCanRead(Expression expression, string paramName)
static bool AreReferenceAssignable(Type dest, Type src)
Definition TypeUtils.cs:673
static void RequiresCanWrite(Expression expression, string paramName)
static UnaryExpression GetUserDefinedUnaryOperatorOrThrow(ExpressionType unaryType, string name, Expression operand)
static UnaryExpression GetMethodBasedUnaryOperator(ExpressionType unaryType, Expression operand, MethodInfo method)

References System.Dynamic.Utils.TypeUtils.AreReferenceAssignable(), System.Linq.Expressions.Expression< TDelegate >.GetMethodBasedUnaryOperator(), System.Linq.Expressions.Expression< TDelegate >.GetUserDefinedUnaryOperatorOrThrow(), System.Dynamic.Utils.ExpressionUtils.RequiresCanRead(), System.Linq.Expressions.Expression< TDelegate >.RequiresCanWrite(), and System.Linq.Expressions.Error.UserDefinedOpMustHaveValidReturnType().

Referenced by System.Linq.Expressions.Expression< TDelegate >.PostDecrementAssign(), System.Linq.Expressions.Expression< TDelegate >.PostDecrementAssign(), System.Linq.Expressions.Expression< TDelegate >.PostIncrementAssign(), System.Linq.Expressions.Expression< TDelegate >.PostIncrementAssign(), System.Linq.Expressions.Expression< TDelegate >.PreDecrementAssign(), System.Linq.Expressions.Expression< TDelegate >.PreDecrementAssign(), System.Linq.Expressions.Expression< TDelegate >.PreIncrementAssign(), and System.Linq.Expressions.Expression< TDelegate >.PreIncrementAssign().