enumtype

How the values of an enumeration are distributed.

Declaración

Sintaxis

enumtype
    = IntegerConsecutiveFromZero
    | IntegerUnique
    | IntegerNotUnique
    | NonInteger

Values

Value

Meaning

IntegerConsecutiveFromZero

the values are 0, 1, 2, … in order. A backend may use one directly as an index.

IntegerUnique

integer values, all different, but not consecutive.

IntegerNotUnique

integer values, with repeats.

NonInteger

the values are not integers, so arithmetic on them is not meaningful.

Valores devueltos

None. An enumeration value is not evaluated.

Descripción

The frontend works this out once, when it builds the Enum, so that a later pass can tell whether a jump table is possible without examining every enumerator.

Ver también

Enum, EnumType, EnumValue