Skip to content

Commit a06e3c8

Browse files
committed
Add a test where the same type is both and async sequence and its iterator
1 parent 7b66e96 commit a06e3c8

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/ModuleInterface/async_sequence_conformance.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,16 @@ public struct OtherSequenceAdapter<Base: AsyncSequence>: AsyncSequence {
5555

5656
// CHECK-NOT: public typealias Failure
5757
}
58+
59+
// CHECK: public struct MineOwnIterator
60+
@available(SwiftStdlib 5.1, *)
61+
public struct MineOwnIterator<Element>: AsyncSequence, AsyncIteratorProtocol {
62+
public mutating func next() async -> Element? { nil }
63+
public func makeAsyncIterator() -> Self { self }
64+
65+
// CHECK: @_implements(_Concurrency.AsyncIteratorProtocol, Failure)
66+
// CHECK-SAME: public typealias __AsyncIteratorProtocol_Failure = Swift.Never
67+
68+
// CHECK: @_implements(_Concurrency.AsyncSequence, Failure)
69+
// CHECK-SAME: public typealias __AsyncSequence_Failure = Swift.Never
70+
}

0 commit comments

Comments
 (0)