In CoreCLR, the maximum allowed size of the base type in an array is 65535, so that this is okay:
var array = new Foo[1];
Console.WriteLine(array);
[InlineArray(65535)]
struct Foo { private byte _first; }
With NativeAOT the above limit becomes 65534 somehow so that it will fail at runtime with:
Unhandled exception. System.TypeLoadException: Array of type 'Foo' from assembly 'ConsoleApp1' cannot be created because base value type is too large.
/cc: @MichalStrehovsky
In CoreCLR, the maximum allowed size of the base type in an array is 65535, so that this is okay:
With NativeAOT the above limit becomes 65534 somehow so that it will fail at runtime with:
/cc: @MichalStrehovsky