enumtype

How the values of an enumeration are distributed.

Declaration

Sintaxe

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 de retorno

None. An enumeration value is not evaluated.

Descrição

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.

Veja Também

Enum, EnumType, EnumValue