Commit 3867774
committed
[stdlib][docs] Clarify BidirectionalCollection requirements
As discussed on the forum, `BidirectionalCollection` requirements as
currently stated can be interpreted to forbid conforming types from
accepting indices that lie between valid (i.e., reachable) indices
in the collection. Among other undesirable effects, this
interpretation would render SE-0180 (String.Index overhaul)
incompatible with these requirements.
Update the wording to clarify that the requirements only apply to
valid indices. (Collection protocols do not constrain the behavior of
invalid indices — it’s up to individual collection types to implement
them as they wish.)
https://forums.swift.org/t/string-index-unification-vs-bidirectionalcollection-requirements/55946
rdar://92297280
(cherry picked from commit b8cbd4f)1 parent e101e9f commit 3867774
1 file changed
+6
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
| 31 | + | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
38 | 42 | | |
39 | 43 | | |
40 | 44 | | |
| |||
0 commit comments