Next: , Previous: Discriminated_Records, Up: Predefined Rules


23.6.10 Enumeration_Ranges_In_CASE_Statements

Flag each use of a range of enumeration literals as a choice in a case statement. All forms for specifying a range (explicit ranges such as A .. B, subtype marks and 'Range attributes) are flagged. An enumeration range is flagged even if contains exactly one enumeration value or no values at all. A type derived from an enumeration type is considered as an enumeration type.

This rule helps prevent maintenance problems arising from adding an enumeration value to a type and having it implicitly handled by an existing case statement with an enumeration range that includes the new literal.

This rule has no parameters.