Description
InlineArray reports wrong size when struct size is specified.
Reproduction Steps
Console.WriteLine(Unsafe.SizeOf<S>());
[InlineArray(length: 2)]
[StructLayout(LayoutKind.Sequential, Size = 42)]
struct S { byte item; }
Expected behavior
42
This should be equivalent to
Console.WriteLine(Unsafe.SizeOf<S>());
[StructLayout(LayoutKind.Sequential, Size = 42)]
struct S { byte item1, item2; }
Actual behavior
84
Regression?
No
Known Workarounds
No
Configuration
No response
Other information
No response