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

◆ RightShiftAssign() [3/3]

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

Definition at line 1848 of file Expression.cs.

1849 {
1850 ExpressionUtils.RequiresCanRead(left, "left");
1851 RequiresCanWrite(left, "left");
1852 ExpressionUtils.RequiresCanRead(right, "right");
1853 if (method == null)
1854 {
1855 if (IsSimpleShift(left.Type, right.Type))
1856 {
1857 if (conversion != null)
1858 {
1859 throw Error.ConversionIsNotSupportedForArithmeticTypes();
1860 }
1861 Type resultTypeOfShift = GetResultTypeOfShift(left.Type, right.Type);
1862 return new SimpleBinaryExpression(ExpressionType.RightShiftAssign, left, right, resultTypeOfShift);
1863 }
1864 return GetUserDefinedAssignOperatorOrThrow(ExpressionType.RightShiftAssign, "op_RightShift", left, right, conversion, liftToNull: true);
1865 }
1866 return GetMethodBasedAssignOperator(ExpressionType.RightShiftAssign, left, right, method, conversion, liftToNull: true);
1867 }
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 bool IsSimpleShift(Type left, Type right)
static BinaryExpression GetMethodBasedAssignOperator(ExpressionType binaryType, Expression left, Expression right, MethodInfo method, LambdaExpression conversion, bool liftToNull)
static Type GetResultTypeOfShift(Type left, Type right)

References System.Linq.Expressions.Error.ConversionIsNotSupportedForArithmeticTypes(), System.Linq.Expressions.Expression< TDelegate >.GetMethodBasedAssignOperator(), System.Linq.Expressions.Expression< TDelegate >.GetResultTypeOfShift(), System.Linq.Expressions.Expression< TDelegate >.GetUserDefinedAssignOperatorOrThrow(), System.Linq.Expressions.Expression< TDelegate >.IsSimpleShift(), System.Dynamic.Utils.ExpressionUtils.RequiresCanRead(), and System.Linq.Expressions.Expression< TDelegate >.RequiresCanWrite().