@@ -2256,7 +2256,7 @@ appears:
2256
2256
2257
2257
* **Pattern-for-in statement**, **pattern-for-in element**, **pattern-for
2258
2258
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
2260
2260
variables) are bound in a new scope for each loop iteration. All pattern
2261
2261
variables are in the same scope. They are considered initialized after the
2262
2262
for loop initializer expression.
@@ -2471,10 +2471,10 @@ the matched value is an *always-exhaustive* type, defined as:
2471
2471
2472
2472
All other types are not always-exhaustive. Then:
2473
2473
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.*
2478
2478
2479
2479
* It is a compile-time error if the cases in a switch expression are not
2480
2480
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:
2512
2512
a type that it can never be equal to, like matching a String against the
2513
2513
constant pattern ` 3 ` .
2514
2514
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.)
2518
2518
2519
2519
* We make this a warning and not an error because it's harmless dead code.
2520
2520
Also, in some cases the exhaustiveness analysis may not be very precise and
0 commit comments