Enumeration
The syntax for enumerations is not yet implemented.
There must be no ambiguities between the variants of an enumeration layout.
Generated Code
Rust
Enumerations are generated as enum
types in Rust:
The actual type can be retrieved using pattern matching.
TypeScript
Enumerations are generated in multiple ways in TypeScript.
If no variants are storing data, an
enum
type is generated:
Otherwise, a union is generated:
Note that any ambiguity between A
and B
is detected at compile time.
Last updated