Skip to content

Commit 0e146a7

Browse files
committed
getting back the op codes asserts
1 parent e038bed commit 0e146a7

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

test/FastExpressionCompiler.IssueTests/Issue461_InvalidProgramException_when_null_checking_type_by_ref.cs

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ public struct Issue461_InvalidProgramException_when_null_checking_type_by_ref :
1414
{
1515
public int Run()
1616
{
17+
Case_equal_nullable_and_object_null();
18+
Case_equal_nullable_and_nullable_null_on_the_left();
1719
Case_not_equal_nullable_decimal();
18-
// Case_equal_nullable_and_object_null();
19-
// Case_equal_nullable_and_nullable_null_on_the_left();
2020
Original_case();
2121
Original_case_null_on_the_right();
2222
return 5;
@@ -89,7 +89,10 @@ public void Original_case_null_on_the_right()
8989
);
9090
}
9191

92-
public struct XX { }
92+
public struct XX
93+
{
94+
public Decimal D;
95+
}
9396

9497
public void Case_equal_nullable_and_object_null()
9598
{
@@ -165,12 +168,12 @@ public void Case_not_equal_nullable_decimal()
165168
ff.PrintIL();
166169
Asserts.IsTrue(ff(1.142m));
167170

168-
// ff.AssertOpCodes(
169-
// OpCodes.Ldarg_1,
170-
// OpCodes.Call, // .get_HasValue()
171-
// OpCodes.Ldc_I4_0,
172-
// OpCodes.Ceq,
173-
// OpCodes.Ret
174-
// );
171+
ff.AssertOpCodes(
172+
OpCodes.Ldarg_1,
173+
OpCodes.Stloc_0,
174+
OpCodes.Ldloca_S,
175+
OpCodes.Call, // .get_HasValue()
176+
OpCodes.Ret
177+
);
175178
}
176179
}

test/FastExpressionCompiler.TestsRunner/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ public class Program
1010
public static void Main()
1111
{
1212
new LightExpression.IssueTests.Issue461_InvalidProgramException_when_null_checking_type_by_ref().Run();
13-
new Issue341_Equality_comparison_between_nullable_and_null_inside_Any_produces_incorrect_compiled_expression().Run();
1413

14+
// new Issue341_Equality_comparison_between_nullable_and_null_inside_Any_produces_incorrect_compiled_expression().Run();
1515
// new LightExpression.IssueTests.Issue460_ArgumentException_when_converting_from_object_to_type_with_explicit_operator().Run();
1616

1717
// todo: @wip add to FEC, check the possibility of the increment compilation and the artifacts reusability

0 commit comments

Comments
 (0)