-
V is [un]assigned after a
switchstatement (§14.11) iff all of the following are true:- V is [un]assigned before every
breakstatement (§14.15) that may exit theswitchstatement. - For each switch rule (§14.11.1) in the switch block, V is [un]assigned after the switch rule expression, switch rule block, or switch rule
throwstatement introduced by the switch rule. - If there is a switch labeled statement group in the switch block, then V is [un]assigned after the last block statement of the last switch labeled statement group.
- If the
switchstatement is not exhaustive (§14.11.1.1), or if the switch block ends with a switch label followed by the}separator, then V is [un]assigned after the selector expression.
- V is [un]assigned before every
-
V is [un]assigned before the selector expression of a
switchstatement iff V is [un]assigned before theswitchstatement. -
V is [un]assigned before any guard associated with the switch block of a
switchstatement iff V is [un]assigned after the selector expression. -
V is [un]assigned before the switch rule expression, switch rule block, or switch rule
throwstatement introduced by a switch rule in the switch block iff V is [un]assigned after the selector expression of theswitchstatement. -
V is [un]assigned before the first block statement of a switch labeled statement group in the switch block iff both of the following are true:
- V is [un]assigned after the selector expression of the
switchstatement. - If the switch labeled statement group is not the first in the switch block, V is [un]assigned after the last block statement of the preceding switch labeled statement group.
- V is [un]assigned after the selector expression of the
-
V is [un]assigned before a block statement that is not the first of a switch labeled statement group in the switch block iff V is [un]assigned after the preceding block statement.