Skip to content

[NativeAOT-LLVM] System.TypeLoadException with inline arrays in .NET 10 #3213

@SamaelHeaven

Description

@SamaelHeaven

When attempting to use inline arrays in .NET 10, I encounter a TypeLoadException. The following code reproduces the issue:

var array = default(System.Runtime.CompilerServices.InlineArray2<int>);
Span<int> span = array;
span[0] = 1;
span[1] = 2;
foreach (var i in span)
{
    Console.WriteLine(i);
}
Unhandled exception. System.TypeLoadException: Could not load type 'System.Runtime.CompilerServices.InlineArray2`1' from assembly 'System.Runtime, Version=10.0.0.0...

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-NativeAOT-LLVMLLVM generation for Native AOT compilation (including Web Assembly)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions