Skip to content

Commit 599f35c

Browse files
committed
[Patterns] Fix a couple of typos and a nesting error.
1 parent 0cc1e25 commit 599f35c

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

working/0546-patterns/patterns-feature-specification.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,7 @@ The static type of a pattern `p` being matched against a value of type `M` is:
969969
var <int, Object>{1: String s} = {1: false}; // Compile-time error.
970970
```
971971
* **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
973973
`Destructure_n_<args...>` where `_n_` is the number of positional
974974
fields and `args...` is a type argument list built from the static
975975
types of the positional field subpatterns, in order.
@@ -1279,25 +1279,25 @@ To match a pattern `p` against a value `v`:
12791279
1. If the pattern has positional fields:
12801280

12811281
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
12831283
fields' static types, then the match fails.
12841284

1285-
2. For each field `f` in `p`:
1285+
2. For each positional and named field `f` in `p`:
12861286

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`.
12921292

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.*
12961296

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.
12991299

1300-
3. If all field subpatterns match, the record pattern matches.
1300+
3. If all field subpatterns match, the record pattern matches.
13011301

13021302
* **Variable binder**, and **variable matcher:**
13031303

0 commit comments

Comments
 (0)