File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
accepted/future-releases/0546-patterns Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -2665,8 +2665,8 @@ for (<keyword> <pattern> in <expression>) <statement>
2665
2665
2666
2666
Where ` <keyword> ` is ` var ` or ` final ` is treated like so:
2667
2667
2668
- 1 . Let ` I ` be the static type of ` <expression> ` , inferred using the context
2669
- type schema of ` <pattern> ` .
2668
+ 1 . Let ` I ` be the static type of ` <expression> ` , inferred using context type
2669
+ schema ` Iterable<P> ` where ` P ` is the context type schema of ` <pattern> ` .
2670
2670
2671
2671
2 . Calculate the element type of ` I ` :
2672
2672
@@ -2700,8 +2700,8 @@ for (<keyword> <pattern> in <expression>) <element>
2700
2700
2701
2701
Where ` <keyword> ` is ` var ` or ` final ` is treated like so:
2702
2702
2703
- 1 . Let ` I ` be the static type of ` <expression> ` , inferred using the context
2704
- type schema of ` <pattern> ` .
2703
+ 1 . Let ` I ` be the static type of ` <expression> ` , inferred using context type
2704
+ schema ` Iterable<P> ` where ` P ` is the context type schema of ` <pattern> ` .
2705
2705
2706
2706
2 . Calculate the element type of ` I ` :
2707
2707
@@ -3526,6 +3526,7 @@ Here is one way it could be broken down into separate pieces:
3526
3526
### 2.23
3527
3527
3528
3528
- Suggest warnings that implementations may want to report.
3529
+ - Correct context type schema for pattern for-in statements and expressions.
3529
3530
3530
3531
### 2.22
3531
3532
You can’t perform that action at this time.
0 commit comments