You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 29, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 29, 2026. It is now read-only.
Furthermore, you can add functions to enum types. These functions will be available to use on every entry type of the enum as well.
Additionally, you can use specific enum entries as independent types for variables and more such as:
func promote_student(person::student student) {}
Please note that passing a variable of type person::student to an argument of type person::student doesn't perform a hint check. Every hint check will be warned by the compiler
Additionally, any enum entry can inherently be used as a value for the parent enum type as long as the enum_resolved_hinting feature is enabled (Enabled by default for small amounts of entries). If the feature is not enabled, a copy of the enum entry value will have to be made into the parent type
Using an enum parent type as an enum entry type will require a check of the enum hint. This hint check will be warned by the compiler.
Technical notes
Noting K is a parent enum type and E an enum entry type.
Type conversions:
K -> E: casting, requires a hint check
E -> K: transmutable, potentially requires a copy. Warn if the case
Memory layout for K
If size must be determined:
Hint bits (enough bits to identify each entry of K)
Value bits (size of the biggest entry of K)
If size doesn't need to be equal:
Hint bits (enough bits to identify each entry of K)
Value bits (size E)
Memory layout of E:
If enum_resolved_hinting:
Hint bits (enough bits to identify each entry of K)
Activity