Skip to content

Commit d00dddb

Browse files
author
Max Moiseev
committed
[stdlib][swift-3-indexing-model] fixing the ReversedCollection/lazy test
1 parent a5a1963 commit d00dddb

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

stdlib/private/StdlibCollectionUnittest/CheckCollectionInstance.swift.gyb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -455,10 +455,6 @@ public func check${Traversal}Collection<
455455
C.Iterator.Element == ${Element},
456456
C.Indices.Iterator.Element == C.Index,
457457
${Element} : Equatable
458-
% if Traversal == 'RandomAccess':
459-
, C.Index : Strideable
460-
, C.Index.Stride == C.IndexDistance
461-
% end
462458
>(
463459
_ expected: ${Expected}, _ collection: C,
464460
${TRACE},

stdlib/public/core/ClosedRange.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ internal enum _ClosedRangeIndexRepresentation<
2727
public struct ClosedRangeIndex<
2828
// WORKAROUND rdar://25214598 - should be Bound : Strideable
2929
Bound : Comparable where Bound : _Strideable, Bound.Stride : Integer
30+
// swift-3-indexing-model: should conform to _Strideable, otherwise
31+
// CountableClosedRange is not interchangeable with CountableRange in all
32+
// contexts.
3033
> : Comparable {
3134
/// Creates the past-the-end position.
3235
internal init() { _value = .pastEnd }

validation-test/stdlib/Lazy.swift.gyb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -753,8 +753,7 @@ tests.test("ReversedCollection/Lazy") {
753753
var calls = 0
754754
let reversedAndMapped = reversed.map { (x) -> Int in calls += 1; return x }
755755
expectEqual(0, calls)
756-
// FIXME: swift-3-indexing-model: should be checkRandomAccessCollection(0...11, reversedAndMapped)
757-
checkBidirectionalCollection(0...11, reversedAndMapped)
756+
checkRandomAccessCollection(0...11, reversedAndMapped)
758757
expectNotEqual(0, calls)
759758
}
760759

0 commit comments

Comments
 (0)