mirror of https://github.com/icsharpcode/ILSpy.git
Browse Source
The existing fixture only exercised value-parameter and rvalue receivers. Element reads and writes decompile correctly for every lvalue receiver kind (instance/readonly/static fields, nested struct fields, array elements, ref/in parameters, this inside the inline array struct incl. readonly methods), for nested inline arrays, reference-type elements, compound assignment/increment, and ref/out/in element arguments, so pin all of that green. Constructs whose output is correct but does not round-trip textually are pinned via EXPECTED_OUTPUT: ref (readonly) locals to elements fold into direct element access, index-from-end and System.Index indexing print as constant/GetOffset indices, and range indexing prints as Span casts plus Slice calls (Roslyn 4.14 lowers open-ended ranges with an explicit length where newer compilers use the single-argument Slice, hence the ROSLYN5 split). This replaces the TODO about variable-length slicing: the output is compilable, just not sugared. Foreach is pinned for the shapes that work: local, rvalue (via temp), early break, and receiver mutation in the body. Broken foreach receiver shapes are covered by the separate ignored InlineArrayForeach fixture. The fixture now uses System.Index/System.Range, which conflict with ICSharpCode.Decompiler's public Index type when compiled into the test assembly, so it moves to the ExcludedTestInputs list like IndexRangeTest. Assisted-by: Claude:claude-fable-5:Claude Codetests/829-inline-arrays
2 changed files with 309 additions and 8 deletions
Loading…
Reference in new issue