[release/9.0] Fix `InlineArray` swift lowering in mono by jkurdek · Pull Request #108483 · dotnet/runtime

Backport of #107744 and #107859 to release/9.0

Customer Impact

  • Customer reported
  • Found internally

In .NET 9 we added swift lowering algorithm to both CoreCLR and Mono backends. This included support for lowering InlineArray. The scenario lacked appropriate tests, once we started working on projections we found out that the Mono path is completely broken (runtime crash when attempting to pass struct annotated with InlineArray).

Regression

  • Yes
  • No

Testing

New test suite for InlineArray lowering. Tests are included in this change.

Risk

Low. Only affects swift interop path on mono. Changes are small, easy to reason about and well tested.