// RUN: %target-swift-frontend -typecheck %s -verify // REQUIRES: concurrency @available(SwiftStdlib 5.1, *) struct MyAsyncSequence: AsyncSequence { struct AsyncIterator: AsyncIteratorProtocol { mutating func next() -> Element? { nil } } func makeAsyncIterator() -> AsyncIterator { .init() } } @available(SwiftStdlib 5.1, *) func testMe(ms: MyAsyncSequence) { let flatMS = ms.flatMap { string in return MyAsyncSequence<[Character]>() } let _: AsyncFlatMapSequence, MyAsyncSequence<[Character]>> = flatMS }