mun
mun copied to clipboard
`enum` type
Similar to Rust's enum, we want to introduce a strongly-typed enum.
Some important considerations:
- Introduction of the
enumtype will also require introduction of pattern matching:- [ ]
if letexpressionif let Enum::Variant = some_enum { .. } else { .. } - [ ]
matchexpressionmatch some_enum { Enum::VariantA => { .. }, Enum::VariantB => { .. }, _ => { .. } } - [ ] Variant decomposition
if let Enum::Variant(a, true) = some_enum { .. } else { .. }
- [ ]
- All variants need to be resolved
When hot reloading, if a variant was removed, we'll throw a runtime error to signal that we could not memory map an existing instance of the enum type.
struct decomposition and pattern matching should be implemented as well
When adding if let, please make sure to also include && to connect multiple conditions.