klyn.Enum.bind
method
public static bind(
instance as Enum,
stateName as String,
typeName as String = "",
ordinal as Int = -1
) as Enum:
Description

Binds an enum instance to its symbolic state name and returns the same instance.

This helper is primarily used by compiler-generated enum code.

Parameters
ParameterDescription
instanceEnum instance produced by the generated enum constructor.
stateNameSymbolic state name.
typeNameOptional display type name.
ordinalZero-based declaration position.
Returns

The same instance, ready to be cast back to the concrete enum type.

Example
enum Color:
RED

assert Color.RED.toString() == "Color.RED"