Skip to content

Commit 2c43038

Browse files
authored
[cxx-interop] Explicitly require CxxSequence's iterator to be CxxIterator
This is needed for automatic synthesis of conformances to `CxxSequence` protocol. It also makes typechecker errors easier to understand when they happen.
1 parent fbccda9 commit 2c43038

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

stdlib/public/Cxx/CxxSequence.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ extension Optional: UnsafeCxxInputIterator where Wrapped: UnsafeCxxInputIterator
6666
public protocol CxxSequence: Sequence {
6767
associatedtype RawIterator: UnsafeCxxInputIterator
6868
associatedtype Element = RawIterator.Pointee
69+
associatedtype Iterator = CxxIterator<Self>
6970

7071
// `begin()` and `end()` have to be mutating, otherwise calling
7172
// `self.sequence.begin()` will copy `self.sequence` into a temporary value,

0 commit comments

Comments
 (0)