Skip to content

Commit 423cfcf

Browse files
authored
Merge pull request #72555 from DougGregor/test-implements-assoc-type-specific
Add test for multiple `@_implements` on associated types
2 parents 53a5b86 + 96f4772 commit 423cfcf

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/Concurrency/async_sequence_syntax.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,15 @@ public struct ReaderSeq: AsyncSequence, Sendable {
119119
func test1() -> Error {
120120
return ReaderSeq.Failure.x
121121
}
122+
123+
@available(SwiftStdlib 5.1, *)
124+
public struct MineOwnIterator<Element>: AsyncSequence, AsyncIteratorProtocol {
125+
public mutating func next() async -> Element? { nil }
126+
public func makeAsyncIterator() -> Self { self }
127+
128+
@_implements(AsyncIteratorProtocol, Failure)
129+
public typealias __AsyncIteratorProtocol_Failure = Never
130+
131+
@_implements(AsyncSequence, Failure)
132+
public typealias __AsyncSequence_Failure = Never
133+
}

0 commit comments

Comments
 (0)