Skip to content

Commit f56f6eb

Browse files
committed
Remove vestigial references to switch collection elements.
They were never specified or supported. Fix #2954.
1 parent 42cf822 commit f56f6eb

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

accepted/future-releases/0546-patterns/feature-specification.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2256,7 +2256,7 @@ appears:
22562256
22572257
* **Pattern-for-in statement**, **pattern-for-in element**, **pattern-for
22582258
statement**, **pattern-for element**: Scoping follows the normal for and
2259-
for-in statement and elements scoping rules where the variable (now
2259+
for-in statement and element scoping rules where the variable (now
22602260
variables) are bound in a new scope for each loop iteration. All pattern
22612261
variables are in the same scope. They are considered initialized after the
22622262
for loop initializer expression.
@@ -2471,10 +2471,10 @@ the matched value is an *always-exhaustive* type, defined as:
24712471

24722472
All other types are not always-exhaustive. Then:
24732473

2474-
* It is a compile-time error if the cases in a switch statement or switch
2475-
collection element are not exhaustive and the static type of the matched
2476-
value is an always-exhaustive type. *There is no error if a switch statement
2477-
is not exhaustive when the type is not an always-exhaustive type.*
2474+
* It is a compile-time error if the cases in a switch statement are not
2475+
exhaustive and the static type of the matched value is an always-exhaustive
2476+
type. *There is no error if a switch statement is not exhaustive when the
2477+
type is not an always-exhaustive type.*
24782478

24792479
* It is a compile-time error if the cases in a switch expression are not
24802480
exhaustive. *This is an error even if the matched value type is not an
@@ -2512,9 +2512,9 @@ encouraged to report a static warning when:
25122512
a type that it can never be equal to, like matching a String against the
25132513
constant pattern `3`.
25142514

2515-
* A case in a switch statement, collection element, or expression is
2516-
unreachable because all values it can match are also matched by preceding
2517-
cases. (The exhaustiveness algorithm can be used to determine this.)
2515+
* A case in a switch statement or expression is unreachable because all values
2516+
it can match are also matched by preceding cases. (The exhaustiveness
2517+
algorithm can be used to determine this.)
25182518

25192519
*We make this a warning and not an error because it's harmless dead code.
25202520
Also, in some cases the exhaustiveness analysis may not be very precise and

0 commit comments

Comments
 (0)