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

◆ RightShift() [2/2]

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

Definition at line 1822 of file Expression.cs.

1823 {
1824 ExpressionUtils.RequiresCanRead(left, "left");
1825 ExpressionUtils.RequiresCanRead(right, "right");
1826 if (method == null)
1827 {
1828 if (IsSimpleShift(left.Type, right.Type))
1829 {
1830 Type resultTypeOfShift = GetResultTypeOfShift(left.Type, right.Type);
1831 return new SimpleBinaryExpression(ExpressionType.RightShift, left, right, resultTypeOfShift);
1832 }
1833 return GetUserDefinedBinaryOperatorOrThrow(ExpressionType.RightShift, "op_RightShift", left, right, liftToNull: true);
1834 }
1835 return GetMethodBasedBinaryOperator(ExpressionType.RightShift, left, right, method, liftToNull: true);
1836 }
static void RequiresCanRead(Expression expression, string paramName)
static BinaryExpression GetMethodBasedBinaryOperator(ExpressionType binaryType, Expression left, Expression right, MethodInfo method, bool liftToNull)
static bool IsSimpleShift(Type left, Type right)
static BinaryExpression GetUserDefinedBinaryOperatorOrThrow(ExpressionType binaryType, string name, Expression left, Expression right, bool liftToNull)
static Type GetResultTypeOfShift(Type left, Type right)

References System.Linq.Expressions.Expression< TDelegate >.GetMethodBasedBinaryOperator(), System.Linq.Expressions.Expression< TDelegate >.GetResultTypeOfShift(), System.Linq.Expressions.Expression< TDelegate >.GetUserDefinedBinaryOperatorOrThrow(), System.Linq.Expressions.Expression< TDelegate >.IsSimpleShift(), and System.Dynamic.Utils.ExpressionUtils.RequiresCanRead().