Wrong StructLayoutAttribute.Size for struct unions with no data fields #18125
Labels
Area-Compiler-CodeGen
IlxGen, ilwrite and things at the backend
Bug
good first issue
help wanted
Impact-Low
(Internal MS Team use only) Describes an issue with limited impact on existing code.
Milestone
Consider this type:
F# 9 compiles it to a struct with this attribute (among others):
However, because of the compiler-generated
_tag
field, the size is actually 4:This seems not to cause any problems, but the documentation states "This field must be equal or greater than the total size, in bytes, of the members of the class or structure," which suggests this should be corrected.
The text was updated successfully, but these errors were encountered: