Description
Applying explicit Size to a struct decorated with InlineArrayAttribute is ambiguous and now is not supported in the type Loader.
.NET 10 Preview 7
Version
Other (please put exact version in description textbox)
Previous behavior
Previously specifying explicit Size would result in implementation specific behavior that may or may not match user's expectations
New behavior
Creating instances of such struct and other uses will result in TypeLoadException thrown.
Type of breaking change
Reason for change
Specifying Size for an inline array struct is ambiguous and any interpretation would contradict specification.
Recommended action
In unlikely case if user needs to specify explicit size either for the array element or for the whole inline array, a struct wrapping the element type or the whole array type can be introduced and in the layout of the wrapper the Size could be specified accordingly and unambiguously.
Feature area
Other (please put exact area in description textbox)
Affected APIs
Affects: TypeLoader. The loader may reject types that were not originally rejected.
Associated WorkItem - 454941
Description
Applying explicit Size to a struct decorated with InlineArrayAttribute is ambiguous and now is not supported in the type Loader.
.NET 10 Preview 7
Version
Other (please put exact version in description textbox)
Previous behavior
Previously specifying explicit
Sizewould result in implementation specific behavior that may or may not match user's expectationsNew behavior
Creating instances of such struct and other uses will result in TypeLoadException thrown.
Type of breaking change
Reason for change
Specifying
Sizefor an inline array struct is ambiguous and any interpretation would contradict specification.Recommended action
In unlikely case if user needs to specify explicit size either for the array element or for the whole inline array, a struct wrapping the element type or the whole array type can be introduced and in the layout of the wrapper the
Sizecould be specified accordingly and unambiguously.Feature area
Other (please put exact area in description textbox)
Affected APIs
Affects: TypeLoader. The loader may reject types that were not originally rejected.
Associated WorkItem - 454941