@@ -969,7 +969,7 @@ The static type of a pattern `p` being matched against a value of type `M` is:
969
969
var <int, Object>{1: String s} = {1: false}; // Compile-time error.
970
970
```
971
971
* **Record binder and matcher:**
972
- 1. If `p` has any position fields, then the static type of `p` is
972
+ 1. If `p` has any positional fields, then the static type of `p` is
973
973
`Destructure_n_<args...>` where `_n_` is the number of positional
974
974
fields and `args...` is a type argument list built from the static
975
975
types of the positional field subpatterns, in order.
@@ -1279,25 +1279,25 @@ To match a pattern `p` against a value `v`:
1279
1279
1 . If the pattern has positional fields:
1280
1280
1281
1281
1 . If ` v ` does not implement the appropriate ` Destructure_n_<...> `
1282
- interface instantiaged with type arguments based on the positional
1282
+ interface instantiated with type arguments based on the positional
1283
1283
fields' static types, then the match fails.
1284
1284
1285
- 2 . For each field ` f ` in ` p ` :
1285
+ 2 . For each positional and named field ` f ` in ` p ` :
1286
1286
1287
- 1 . Call the corresponding getter on ` v ` to get result ` r ` . If ` f `
1288
- is a positional field, then the getter is named ` field_n_ ` where
1289
- ` _n_ ` is the zero-based index of the positional field, ignoring
1290
- other named fields. If ` f ` is named, then the getter has the
1291
- same name as ` f ` .
1287
+ 1 . Call the corresponding getter on ` v ` to get result ` r ` . If ` f `
1288
+ is a positional field, then the getter is named ` field_n_ ` where
1289
+ ` _n_ ` is the zero-based index of the positional field, ignoring
1290
+ other named fields. If ` f ` is named, then the getter has the
1291
+ same name as ` f ` .
1292
1292
1293
- * If ` v ` has type ` dynamic ` , this getter call may throw a
1294
- NoSuchMethodError, which we allow to propagate instead of
1295
- treating that as a match failure.*
1293
+ * If ` v ` has type ` dynamic ` , this getter call may throw a
1294
+ NoSuchMethodError, which we allow to propagate instead of
1295
+ treating that as a match failure.*
1296
1296
1297
- 2 . Match the subpattern of ` f ` against ` r ` . If the match fails,
1298
- the record match fails.
1297
+ 2 . Match the subpattern of ` f ` against ` r ` . If the match fails,
1298
+ the record match fails.
1299
1299
1300
- 3 . If all field subpatterns match, the record pattern matches.
1300
+ 3 . If all field subpatterns match, the record pattern matches.
1301
1301
1302
1302
* ** Variable binder** , and ** variable matcher:**
1303
1303
0 commit comments