We currently differentiate between enums and structs for exported items: The Export enum has separate variants for Struct and Enum, and we have different Struct and Enum types. In practice though, these end up almost identical:
This setup also introduces some problems for the C# code generation:
Both enums and structs will ultimately need to support being marshaled as handles, which is done the same way for both structs and enums. The current setup makes it hard to share this logic, though.
Right now there's potential for mismatch between the schema for the type and the declared export type, e.g. the schema for an exported struct could potentially describe it as some other type. We should generally defer to what the schema says, but the current setup makes that hard to do.
We could improve this by unifying struct and enum exports into a single "named export" type.
We currently differentiate between enums and structs for exported items: The
Export
enum has separate variants forStruct
andEnum
, and we have differentStruct
andEnum
types. In practice though, these end up almost identical:This setup also introduces some problems for the C# code generation:
We could improve this by unifying struct and enum exports into a single "named export" type.