Skip to content

Commit 877af00

Browse files
committed
wip: subtract #314
1 parent 246bb62 commit 877af00

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/FastExpressionCompiler.LightExpression/Expression.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,15 +1206,17 @@ public static BinaryExpression RightShift(Expression left, Expression right) =>
12061206

12071207
/// <summary>Creates a BinaryExpression that represents an arithmetic subtraction operation that does not have overflow checking.</summary>
12081208
public static BinaryExpression Subtract(Expression left, Expression right) =>
1209-
new LeftTypedBinaryExpression(ExpressionType.Subtract, left, right);
1209+
GetArithmeticLeftTypedBinary(ExpressionType.Subtract, left, right);
12101210

1211-
public static BinaryExpression Subtract(Expression left, Expression right, MethodInfo method) => GetLeftTypedBinary(ExpressionType.Subtract, left, right, method);
1211+
public static BinaryExpression Subtract(Expression left, Expression right, MethodInfo method) =>
1212+
GetArithmeticLeftTypedBinary(ExpressionType.Subtract, left, right, method);
12121213

12131214
/// <summary>Creates a BinaryExpression that represents an arithmetic subtraction operation that has overflow checking.</summary>
12141215
public static BinaryExpression SubtractChecked(Expression left, Expression right) =>
1215-
new LeftTypedBinaryExpression(ExpressionType.SubtractChecked, left, right);
1216+
GetArithmeticLeftTypedBinary(ExpressionType.SubtractChecked, left, right);
12161217

1217-
public static BinaryExpression SubtractChecked(Expression left, Expression right, MethodInfo method) => GetLeftTypedBinary(ExpressionType.SubtractChecked, left, right, method);
1218+
public static BinaryExpression SubtractChecked(Expression left, Expression right, MethodInfo method) =>
1219+
GetArithmeticLeftTypedBinary(ExpressionType.SubtractChecked, left, right, method);
12181220

12191221
/// <summary>Creates a BinaryExpression that represents an arithmetic multiplication operation that does not have overflow checking.</summary>
12201222
public static BinaryExpression Multiply(Expression left, Expression right) =>

test/FastExpressionCompiler.TestsRunner/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ public class Program
1010
public static void Main()
1111
{
1212
RunAllTests();
13-
//new Issue314_LiftToNull_ToExpressionString().Run();
14-
//new FastExpressionCompiler.LightExpression.IssueTests.Issue314_LiftToNull_ToExpressionString().Run();
13+
// new Issue314_LiftToNull_ToExpressionString().Run();
14+
// new FastExpressionCompiler.LightExpression.IssueTests.Issue314_LiftToNull_ToExpressionString().Run();
1515

1616
// new Issue309_InvalidProgramException_with_MakeBinary_liftToNull_true().Run();
1717
// new FastExpressionCompiler.LightExpression.IssueTests.Issue309_InvalidProgramException_with_MakeBinary_liftToNull_true().Run();

0 commit comments

Comments
 (0)