enum
As in C, the first member of the enum has a value of zero and each successive value is incremented by one.
X::SomeEnum::One # => One
You can specify the value of a member:
The type of an enum member is Int32
by default, even if you specify a different type in a constant value:
lib X
enum SomeEnum
A = 1_u32
end
X::SomeEnum # => 1_i32
You can use an enum as a type in a parameter or struct
or union
members:
lib X
One
Two
end