Conversation
|
I added a fix, and all original tests of https://github.com/bluewingHuang/FastExpressionCompiler/blob/SortCompileError/CompileTest/SortCompilerTests.cs now pass. please review. |
Is it really outputs Nullable indtead of Nullable? |
| public void ArrayInList_ArrayAcceesError(TestContext t) | ||
| { | ||
| List<Expression> exps = new List<Expression>(); | ||
| var dataArrayList = Parameter(typeof(List<int?[]>), "dataArrayList"); |
There was a problem hiding this comment.
What if instead int? the array will contain SomeStruct?
and the final access will drill to the int? field of this struct,
e.g. like dataArrayList[x][y].Foo where Foo is int? SomeStruct.Foo.
There was a problem hiding this comment.
Is there a problem with this fix, or do I need to add more unit tests?
f24f61d to
4c72cff
Compare
I Changed the return value void and added several new unit tests. The unit tests for Struct were passing even before the fix. |
|
I don't get it. Doed PrintCSharp output Nullable[] or Nullable[]? |
It was Nullable[]. I didn't edit the output and I can't reproduce it. All the new runs print:
|
|
Ok. Great. Thank you for the QR and fix. Merging |
test output
//Issue499_InvalidProgramException_for_Sorting_and_comparison_function.ArrayInList_ArrayAcceesError
var _ = (Action<List<Nullable[]>>)((List<Nullable[]> dataArrayList) => //void
{
int left_ListIndex = default;
int left_ArrayIndex = default;
int? left_0 = null;
left_ListIndex = 0;
left_ArrayIndex = 0;
left_0 = dataArrayList[left_ListIndex][left_ArrayIndex];
});
<ArrayInList_ArrayAcceesError>
IL_0000: ldc.i4.0
IL_0001: stloc.0
IL_0002: ldc.i4.0
IL_0003: stloc.1
IL_0004: ldarg.1
IL_0005: ldloc.0
IL_0006: callvirt Nullable[] List<Nullable[]>.get_Item(Int32)
IL_0011: ldloc.1
IL_0012: ldelem int?
IL_0017: stloc.2
IL_0018: ret
</ArrayInList_ArrayAcceesError>
<ArrayInList_ArrayAcceesError>
IL_0000: ldc.i4.0
IL_0001: stloc.0
IL_0002: ldc.i4.0
IL_0003: stloc.1
IL_0004: ldarg.1
IL_0005: ldloca.s V_0
IL_0007: callvirt Nullable[] List<Nullable[]>.get_Item(Int32)
IL_0012: ldloc.1
IL_0013: ldelem int?
IL_0018: stloc.2
IL_0019: ret
</ArrayInList_ArrayAcceesError>