Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions standard/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,6 @@
- [§11.2.5](patterns.md#1125-positional-pattern) Positional pattern
- [§11.2.6](patterns.md#1126-property-pattern) Property pattern
- [§11.2.7](patterns.md#1127-discard-pattern) Discard pattern
- [§11.3](patterns.md#113-pattern-subsumption) Pattern subsumption
- [§11.4](patterns.md#114-pattern-exhaustiveness) Pattern exhaustiveness
- [§12](expressions.md#12-expressions) Expressions
- [§12.1](expressions.md#121-general) General
- [§12.2](expressions.md#122-expression-classifications) Expression classifications
Expand Down
2 changes: 1 addition & 1 deletion standard/expressions.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# 12 Expressions

Check warning on line 1 in standard/expressions.md

View workflow job for this annotation

GitHub Actions / Markdown to Word Converter

standard/expressions.md#L1

MDC032::Line length 83 > maximum 81

Check warning on line 2 in standard/expressions.md

View workflow job for this annotation

GitHub Actions / Markdown to Word Converter

standard/expressions.md#L2

MDC032::Line length 84 > maximum 81
## 12.1 General

Check warning on line 3 in standard/expressions.md

View workflow job for this annotation

GitHub Actions / Markdown to Word Converter

standard/expressions.md#L3

MDC032::Line length 85 > maximum 81

Check warning on line 3 in standard/expressions.md

View workflow job for this annotation

GitHub Actions / Markdown to Word Converter

standard/expressions.md#L3

MDC032::Line length 86 > maximum 81

An expression is a sequence of operators and operands. This clause defines the syntax, order of evaluation of operands and operators, and meaning of expressions.

Check warning on line 5 in standard/expressions.md

View workflow job for this annotation

GitHub Actions / Markdown to Word Converter

standard/expressions.md#L5

MDC032::Line length 82 > maximum 81

Check warning on line 6 in standard/expressions.md

View workflow job for this annotation

GitHub Actions / Markdown to Word Converter

standard/expressions.md#L6

MDC032::Line length 82 > maximum 81

Check warning on line 6 in standard/expressions.md

View workflow job for this annotation

GitHub Actions / Markdown to Word Converter

standard/expressions.md#L6

MDC032::Line length 82 > maximum 81
## 12.2 Expression classifications

### 12.2.1 General

The result of an expression is classified as one of the following:

Check warning on line 12 in standard/expressions.md

View workflow job for this annotation

GitHub Actions / Markdown to Word Converter

standard/expressions.md#L12

MDC032::Line length 82 > maximum 81
- A value. Every value has an associated type.
- A variable. Unless otherwise specified, a variable is explicitly typed and has an associated type, namely the declared type of the variable. An implicitly typed variable has no associated type.
- A null literal. An expression with this classification can be implicitly converted to a reference type or nullable value type.
Expand Down Expand Up @@ -3889,7 +3889,7 @@
- The type of the *switch_expression* is the best common type [§12.6.3.16](expressions.md#126316-finding-the-best-common-type-of-a-set-of-expressions)) of the *switch_expression_arm_expression*s of the *switch_expression_arm*s, if such a type exists, and each *switch_expression_arm_expression* can be implicitly converted to that type.
- It is an error if no such type exists.

It is an error if the pattern of any *switch_expression_arm* is *subsumed* by (§11.1) the set of patterns of earlier *unguarded* ([§13.8.3](statements.md#1383-the-switch-statement)) *switch_expression_arm*s of the switch expression.
It is an error if the pattern of any *switch_expression_arm* is *subsumed* by ([§11.1](patterns.md#111-general)) the set of patterns of earlier *unguarded* ([§13.8.3](statements.md#1383-the-switch-statement)) *switch_expression_arm*s of the switch expression.

A switch expression is *exhaustive* if every value of its input is handled by at least one arm of the switch expression. A warning may be issued if a switch expression is not exhaustive.

Expand Down
6 changes: 3 additions & 3 deletions standard/statements.md
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ There can be at most one `default` label in a `switch` statement.

It is an error if the pattern of any switch label is not *applicable* ([§11.2.1](patterns.md#1121-general)) to the type of the input expression.

It is an error if the pattern of any switch label is *subsumed* by (§11.1) the set of patterns of earlier *unguarded* switch labels of the switch statement.
It is an error if the pattern of any switch label is *subsumed* by ([§11.1](patterns.md#111-general)) the set of patterns of earlier *unguarded* switch labels of the switch statement.

> *Example*:
>
Expand Down Expand Up @@ -949,7 +949,7 @@ A switch label is reachable if at least one of the following is true:
- The switch’s *selector_expression* is not a constant value and either
- the label is a `case` without a guard or with a guard whose value is not the constant false; or
- it is a `default` label and
- the set of patterns appearing among the cases of the switch statement that do not have guards or have guards whose value is the constant true, is not *exhaustive* (§11.1) for the switch governing type; or
- the set of patterns appearing among the cases of the switch statement that do not have guards or have guards whose value is the constant true, is not *exhaustive* ([§11.1](patterns.md#111-general)) for the switch governing type; or
- the switch governing type is a nullable type and the set of patterns appearing among the cases of the switch statement that do not have guards or have guards whose value is the constant true does not contain a pattern that would match the value `null`.
- The switch label is referenced by a reachable `goto case` or `goto default` statement.

Expand All @@ -959,7 +959,7 @@ The end point of a `switch` statement is reachable if the switch statement is re

- The `switch` statement contains a reachable `break` statement that exits the `switch` statement.
- No `default` label is present and either
- The switch’s *selector_expression* is a non-constant value, and the set of patterns appearing among the cases of the switch statement that do not have guards or have guards whose value is the constant true, is not *exhaustive* (§11.1) for the switch governing type.
- The switch’s *selector_expression* is a non-constant value, and the set of patterns appearing among the cases of the switch statement that do not have guards or have guards whose value is the constant true, is not *exhaustive* ([§11.1](patterns.md#111-general)) for the switch governing type.
- The switch’s *selector_expression* is a non-constant value of a nullable type, and no pattern appearing among the cases of the switch statement that do not have guards or have guards whose value is the constant true would match the value `null`.
- The switch’s *selector_expression* is a constant value and no `case` label without a guard or whose guard is the constant true would match that value.

Expand Down
Loading