File tree Expand file tree Collapse file tree 3 files changed +8
-18
lines changed Expand file tree Collapse file tree 3 files changed +8
-18
lines changed Original file line number Diff line number Diff line change @@ -65,8 +65,8 @@ public protocol _BidirectionalIndexable : _Indexable {
65
65
/// `c.index(before: c.index(after: i)) == i`.
66
66
/// - If `i > c.startIndex && i <= c.endIndex`
67
67
/// `c.index(after: c.index(before: i)) == i`.
68
- public protocol BidirectionalCollection
69
- : _BidirectionalIndexable , Collection {
68
+ public protocol BidirectionalCollection : _BidirectionalIndexable , Collection
69
+ where SubSequence : BidirectionalCollection {
70
70
71
71
// TODO: swift-3-indexing-model - replaces functionality in BidirectionalIndex
72
72
/// Returns the position immediately before the given index.
@@ -84,10 +84,7 @@ public protocol BidirectionalCollection
84
84
85
85
/// A sequence that can represent a contiguous subrange of the collection's
86
86
/// elements.
87
- associatedtype SubSequence : _BidirectionalIndexable , Collection
88
- = BidirectionalSlice < Self >
89
- // FIXME(ABI)#93 (Recursive Protocol Constraints):
90
- // associatedtype SubSequence : BidirectionalCollection
87
+ associatedtype SubSequence = BidirectionalSlice < Self >
91
88
92
89
/// A type that represents the indices that are valid for subscripting the
93
90
/// collection, in ascending order.
Original file line number Diff line number Diff line change @@ -196,14 +196,9 @@ public protocol _MutableIndexable : _Indexable {
196
196
/// // Must be equivalent to:
197
197
/// a[i] = x
198
198
/// let y = x
199
- public protocol MutableCollection : _MutableIndexable , Collection {
200
- // FIXME(ABI)#181: should be constrained to MutableCollection
201
- // (<rdar://problem/20715009> Implement recursive protocol
202
- // constraints)
203
- /// A collection that represents a contiguous subrange of the collection's
204
- /// elements.
205
- associatedtype SubSequence : Collection /*: MutableCollection*/
206
- = MutableSlice < Self >
199
+ public protocol MutableCollection : _MutableIndexable , Collection
200
+ where SubSequence: MutableCollection {
201
+ associatedtype SubSequence = MutableSlice < Self >
207
202
208
203
/// Accesses the element at the specified position.
209
204
///
Original file line number Diff line number Diff line change @@ -48,13 +48,11 @@ public protocol _RandomAccessIndexable : _BidirectionalIndexable {
48
48
/// `distance(from:to:)` methods with O(1) efficiency.
49
49
public protocol RandomAccessCollection :
50
50
_RandomAccessIndexable , BidirectionalCollection
51
+ where SubSequence: RandomAccessCollection
51
52
{
52
53
/// A collection that represents a contiguous subrange of the collection's
53
54
/// elements.
54
- associatedtype SubSequence : _RandomAccessIndexable , BidirectionalCollection
55
- = RandomAccessSlice < Self >
56
- // FIXME(ABI)#102 (Recursive Protocol Constraints):
57
- // associatedtype SubSequence : RandomAccessCollection
55
+ associatedtype SubSequence = RandomAccessSlice < Self >
58
56
59
57
/// A type that represents the indices that are valid for subscripting the
60
58
/// collection, in ascending order.
You can’t perform that action at this time.
0 commit comments