We add the switch expression to the set of syntactic forms permitted in an expression_statement:
expression_statement
: statement_expression ';'
;
statement_expression
: switch_expression
// in addition to all the other forms specified elsewhere
;
When a switch expression is used as a statement_expression,
- the expression of each arm of the switch expression is required to be a statement_expression or a throw_expression; and
- the switch expression is not required to have a type.
We add the switch expression to the set of syntactic forms permitted in an expression_statement:
When a switch expression is used as a statement_expression,