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

◆ LeftShift() [2/2]

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

Definition at line 1770 of file Expression.cs.

1771 {
1772 ExpressionUtils.RequiresCanRead(left, "left");
1773 ExpressionUtils.RequiresCanRead(right, "right");
1774 if (method == null)
1775 {
1776 if (IsSimpleShift(left.Type, right.Type))
1777 {
1778 Type resultTypeOfShift = GetResultTypeOfShift(left.Type, right.Type);
1779 return new SimpleBinaryExpression(ExpressionType.LeftShift, left, right, resultTypeOfShift);
1780 }
1781 return GetUserDefinedBinaryOperatorOrThrow(ExpressionType.LeftShift, "op_LeftShift", left, right, liftToNull: true);
1782 }
1783 return GetMethodBasedBinaryOperator(ExpressionType.LeftShift, left, right, method, liftToNull: true);
1784 }
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().