@@ -56,11 +56,11 @@ public func check${inc.capitalize()}rementable<Instances, BaseCollection>(
5656 _ instances: Instances,
5757 of baseCollection: BaseCollection,
5858 equalityOracle: ( Instances . Index, Instances . Index) - > Bool,
59- ${ end} Index: Instances. Iterator . Element, ${ TRACE}
59+ ${ end} Index: Instances. Element, ${ TRACE}
6060) where
6161 Instances : Collection,
6262 BaseCollection : ${ protocol} ,
63- Instances . Iterator . Element == BaseCollection . Index {
63+ Instances . Element == BaseCollection . Index {
6464
6565 checkEquatable ( instances, oracle: equalityOracle, ${ trace} )
6666 for i in instances {
@@ -82,20 +82,20 @@ internal func _checkIncrementalAdvance<Instances, BaseCollection>(
8282 _ instances: Instances ,
8383 of baseCollection : BaseCollection ,
8484 equalityOracle: ( Instances . Index , Instances . Index ) -> Bool ,
85- limit: Instances . Iterator . Element ,
86- sign: BaseCollection . IndexDistance , // 1 or -1
87- next: ( Instances . Iterator . Element ) -> Instances . Iterator . Element ,
85+ limit: Instances . Element ,
86+ sign: Int , // 1 or -1
87+ next: ( Instances . Element ) -> Instances . Element ,
8888 ${ TRACE}
8989) where
9090 Instances : Collection ,
9191 BaseCollection : Collection ,
92- Instances. Iterator . Element == BaseCollection . Index {
92+ Instances. Element == BaseCollection . Index {
9393 for i in instances {
94- let d : BaseCollection . IndexDistance = sign > 0 ?
94+ let d : Int = sign > 0 ?
9595 baseCollection. distance ( from: i, to: limit) :
9696 - baseCollection. distance ( from: limit, to: i)
9797
98- var offset : BaseCollection . IndexDistance = 0
98+ var offset : Int = 0
9999 for _ in 0 ... Int64 ( d * sign) {
100100 let j = baseCollection. index ( i, offsetBy: offset)
101101 let k = baseCollection. index ( i, offsetBy: offset + sign, limitedBy: limit) ?? limit
@@ -119,11 +119,11 @@ public func checkForwardIndex<Instances, BaseCollection>(
119119 _ instances: Instances ,
120120 of baseCollection: BaseCollection ,
121121 equalityOracle: ( Instances . Index , Instances . Index ) -> Bool ,
122- endIndex: Instances . Iterator . Element , ${ TRACE}
122+ endIndex: Instances . Element , ${ TRACE}
123123) where
124124 Instances : Collection ,
125125 BaseCollection : Collection ,
126- Instances. Iterator . Element == BaseCollection . Index {
126+ Instances. Element == BaseCollection . Index {
127127
128128 checkIncrementable ( instances, of: baseCollection,
129129 equalityOracle: equalityOracle, endIndex: endIndex, ${ trace} )
@@ -144,13 +144,13 @@ public func checkBidirectionalIndex<Instances, BaseCollection>(
144144 _ instances: Instances ,
145145 of baseCollection: BaseCollection ,
146146 equalityOracle: ( Instances . Index , Instances . Index ) -> Bool ,
147- startIndex: Instances . Iterator . Element ,
148- endIndex: Instances . Iterator . Element ,
147+ startIndex: Instances . Element ,
148+ endIndex: Instances . Element ,
149149 ${ TRACE}
150150) where
151151 Instances: Collection ,
152152 BaseCollection : BidirectionalCollection ,
153- Instances. Iterator . Element == BaseCollection . Index {
153+ Instances. Element == BaseCollection . Index {
154154
155155 checkForwardIndex ( instances, of: baseCollection,
156156 equalityOracle: equalityOracle, endIndex: endIndex)
@@ -176,18 +176,18 @@ public func checkRandomAccessIndex<Instances, Distances, BaseCollection>(
176176 _ instances: Instances , distances: Distances ,
177177 of baseCollection: BaseCollection ,
178178 distanceOracle:
179- ( Instances . Index , Instances . Index ) -> Distances . Iterator . Element ,
179+ ( Instances . Index , Instances . Index ) -> Distances . Element ,
180180 advanceOracle:
181- ( Instances . Index , Distances . Index ) -> Instances . Iterator . Element ,
181+ ( Instances . Index , Distances . Index ) -> Instances . Element ,
182182 startIndex: Instances . Iterator . Element ,
183183 endIndex: Instances . Iterator . Element ,
184184 ${ TRACE}
185185) where
186186 Instances : Collection ,
187187 Distances : Collection ,
188188 BaseCollection : RandomAccessCollection ,
189- Instances. Iterator . Element == BaseCollection . Index ,
190- Distances. Iterator . Element == BaseCollection . IndexDistance {
189+ Instances. Element == BaseCollection . Index ,
190+ Distances. Element == Int {
191191
192192 checkBidirectionalIndex ( instances, of: baseCollection,
193193 equalityOracle: { distanceOracle ( $0, $1) == 0 } ,
@@ -207,16 +207,16 @@ public func checkAdvancesAndDistances<Instances, Distances, BaseCollection>(
207207 _ instances: Instances , distances: Distances ,
208208 of baseCollection: BaseCollection ,
209209 distanceOracle:
210- ( Instances . Index , Instances . Index ) -> Distances . Iterator . Element ,
210+ ( Instances . Index , Instances . Index ) -> Distances . Element ,
211211 advanceOracle:
212- ( Instances . Index , Distances . Index ) -> Instances . Iterator . Element ,
212+ ( Instances . Index , Distances . Index ) -> Instances . Element ,
213213 ${ TRACE}
214214) where
215215 Instances : Collection ,
216216 Distances : Collection ,
217217 BaseCollection : Collection ,
218- Instances. Iterator . Element == BaseCollection . Index ,
219- Distances. Iterator . Element == BaseCollection . IndexDistance {
218+ Instances. Element == BaseCollection . Index ,
219+ Distances. Element == Int {
220220
221221 checkComparable (
222222 instances,
@@ -246,7 +246,7 @@ public func checkAdvancesAndDistances<Instances, Distances, BaseCollection>(
246246// picked up when the caller passes a literal), and another that
247247// accepts any appropriate Collection type.
248248% for genericParam , Element, Expected in [
249- % ( 'Expected: Collection', 'Expected. Iterator . Element', 'Expected') ,
249+ % ( 'Expected: Collection', 'Expected. Element', 'Expected') ,
250250% ( 'Element' , 'Element' , 'Array< Element> ') ] :
251251
252252// Top-level check for Collection instances. Alias for checkForwardCollection.
@@ -257,7 +257,7 @@ public func checkCollection<${genericParam}, C : Collection>(
257257 ${ TRACE} ,
258258 resiliencyChecks: CollectionMisuseResiliencyChecks = . all,
259259 sameValue: ( ${ Element} , ${ Element} ) - > Bool
260- ) where C. Iterator . Element == ${ Element} {
260+ ) where C . Element == ${ Element} {
261261
262262 checkForwardCollection ( expected, collection, message ( ) ,
263263 stackTrace: stackTrace, showFrame: showFrame, file: file, line: line,
@@ -276,7 +276,7 @@ public func check${Traversal}Collection<
276276 ${ TRACE} ,
277277 resiliencyChecks: CollectionMisuseResiliencyChecks = . all
278278) where
279- C . Iterator . Element == ${ Element} ,
279+ C . Element == ${ Element} ,
280280 ${ Element} : Equatable {
281281
282282 check ${ Traversal} Collection(
@@ -296,7 +296,7 @@ public func check${Traversal}Collection<
296296 resiliencyChecks: CollectionMisuseResiliencyChecks = . all,
297297 sameValue: ( ${ Element} , ${ Element} ) - > Bool
298298) where
299- C . Iterator . Element == ${ Element} {
299+ C . Element == ${ Element} {
300300
301301 checkOneLevelOf ${ Traversal} Collection( expected, collection, ${ trace} ,
302302 resiliencyChecks: resiliencyChecks, sameValue: sameValue)
@@ -324,7 +324,7 @@ public func checkOneLevelOf${Traversal}Collection<
324324 ${ TRACE} ,
325325 resiliencyChecks: CollectionMisuseResiliencyChecks = . all,
326326 sameValue: ( ${ Element} , ${ Element} ) - > Bool
327- ) where C. Iterator . Element == ${ Element} {
327+ ) where C. Element == ${ Element} {
328328
329329 // A `Collection` is a multi-pass `Sequence`.
330330 for _ in 0 ..< 3 {
@@ -370,7 +370,7 @@ public func checkOneLevelOf${Traversal}Collection<
370370
371371% else:
372372% assert( Traversal == 'Rando mAccess')
373- typealias Distance = C . IndexDistance
373+ typealias Distance = Int
374374
375375 let count: Distance = collection. count
376376 let offset0 = min ( 5 , count)
@@ -501,7 +501,7 @@ ${genericParam}, S : ${TraversalCollection}
501501 resiliencyChecks: CollectionMisuseResiliencyChecks = . all,
502502 sameValue: ( ${ Element} , ${ Element} ) - > Bool
503503) where
504- S . Iterator . Element == ${ Element} {
504+ S . Element == ${ Element} {
505505
506506 let expectedArray = Array ( expected)
507507
@@ -564,14 +564,14 @@ public func checkRangeReplaceable<C, N>(
564564) where
565565 C : RangeReplaceableCollection,
566566 N : Collection,
567- C . Iterator . Element : Equatable,
568- C . Iterator . Element == N . Iterator . Element {
567+ C . Element : Equatable,
568+ C . Element == N . Element {
569569
570570 typealias A = C
571571
572572 // First make an independent copy of the array that we can use for
573573 // comparison later.
574- let source = Array < A . Iterator . Element > ( makeCollection ( ) )
574+ let source = Array < A . Element > ( makeCollection ( ) )
575575
576576 for (ix, i) in source. indices. enumerated ( ) {
577577 for (jx_, j) in ( i..< source. endIndex) . enumerated ( ) {
0 commit comments