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

◆ LeftShiftAssign() [3/3]

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

Definition at line 1796 of file Expression.cs.

1797 {
1798 ExpressionUtils.RequiresCanRead(left, "left");
1799 RequiresCanWrite(left, "left");
1800 ExpressionUtils.RequiresCanRead(right, "right");
1801 if (method == null)
1802 {
1803 if (IsSimpleShift(left.Type, right.Type))
1804 {
1805 if (conversion != null)
1806 {
1807 throw Error.ConversionIsNotSupportedForArithmeticTypes();
1808 }
1809 Type resultTypeOfShift = GetResultTypeOfShift(left.Type, right.Type);
1810 return new SimpleBinaryExpression(ExpressionType.LeftShiftAssign, left, right, resultTypeOfShift);
1811 }
1812 return GetUserDefinedAssignOperatorOrThrow(ExpressionType.LeftShiftAssign, "op_LeftShift", left, right, conversion, liftToNull: true);
1813 }
1814 return GetMethodBasedAssignOperator(ExpressionType.LeftShiftAssign, left, right, method, conversion, liftToNull: true);
1815 }
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().