Payload enums
A stable u32 tag and canonical payload layout define ordinary enums, Option, and Result.
DByte 12.0 · Language
Contract§
There is no niche, null, or smallest-tag optimization.
Mechanics§
Every ordinary payload enum has a u32 tag at offset zero, declaration-order discriminants and payload storage aligned to the maximum variant payload. Option and Result are ordinary prelude enums with this representation.
Validation and failure§
Construction requires a resolved VariantId and exact payload shape. Invalid runtime tags lead only to the explicit unreachable/trap edge prepared by exhaustive canonical analysis.
Evidence and boundary§
Enum ABI tests inspect tag/payload offsets and native execution constructs, stores, matches and returns concrete variants.