enum
Updatedenum Name<T> Unit Payload(T) end
Variants with optional payloads. A unit enum is a string union at runtime; a payload enum is a tagged table. match takes it apart and impl Name adds methods. A unit enum is a string, so its methods are called on the enum: Status.describe(s). <T> takes parameters a payload may name, the way a struct does, and impl Name<T> names them in a method.
The word is also free as a name. enum before a name on the same line declares; local enum = { Idle = 1 } and enum.Idle read the Luau way.
