@@ -1771,25 +1771,25 @@ The context type schema for a pattern `p` is:
1771
1771
1772
1772
* **Variable**:
1773
1773
1774
- 1. In an assignment context, the context type schema is the static type of
1775
- the variable that `p` resolves to.
1776
-
1777
- 1. Else if `p` has no type annotation, the context type schema is `_`.
1778
- *This lets us potentially infer the variable's type from the matched
1779
- value.*
1780
-
1781
- 2. Else the context type schema is the annotated type. *When a typed
1782
- variable pattern is used in a destructuring variable declaration, we
1783
- do push the type over to the value for inference, as in:*
1774
+ 1. If `p` has a type annotation, the context type schema is the annotated
1775
+ type. *When a typed variable pattern is used in a destructuring variable
1776
+ declaration, we push the type over to the value for inference, as in:*
1784
1777
1785
1778
```dart
1786
1779
var (items: List<int> x) = (items: []);
1787
1780
// ^- Infers List<int>.
1788
1781
```
1789
1782
1790
- * **Identifier**: Context type schemas are only used in irrefutable contexts,
1791
- so an identifier pattern is always a variable and is handled like a
1792
- variable pattern, as above.
1783
+ 2. Else the context type schema is `_`. *This lets us potentially infer the
1784
+ variable's type from the matched value.*
1785
+
1786
+ * **Identifier**:
1787
+
1788
+ 1. In an assignment context, the context type schema is the static type of
1789
+ the variable that `p` resolves to.
1790
+
1791
+ 2. Else the context type schema is `_`. *This lets us potentially infer the
1792
+ variable's type from the matched value.*
1793
1793
1794
1794
* **Cast**: The context type schema is `_`.
1795
1795
0 commit comments