public static bind(instance as Enum, stateName as String, typeName as String = "") as Enum:
Binds an enum instance to its symbolic state name and returns the same instance.
This helper is primarily used by compiler-generated enum code.
| Parameter | Description |
|---|---|
instance | Enum instance produced by the generated enum constructor. |
stateName | Symbolic state name. |
typeName | Optional enum type name. |
The same instance, ready to be cast back to the concrete enum type.
enum Color: RED assert Color.RED.toString() == "Color.RED"