Files
swift-mirror/test/Concurrency/async_task_groups_as_sequence.swift
Doug Gregor f85eed4858 Bring back TaskGroup.next() and ThrowingTaskGroup.next() as public API
With the introduction of `next(isolation:)` into the task group types,
we removed the public APIs for the no-argument `next()` versions,
leaving them only as `@usableFromInline internal` entrypoints for the
ABI. Because the `next(isolation:)` versions have a default argument,
this was sufficient for providing source compatibility for calls, but
not for protocol conformances.

Bring these APIs back publicly. Fixes rdar://127499568.
2024-05-03 12:09:55 -07:00

23 lines
1.2 KiB
Swift

// RUN: %target-swift-frontend -disable-availability-checking %s -emit-sil -o /dev/null -verify
// RUN: %target-swift-frontend -disable-availability-checking %s -emit-sil -o /dev/null -verify -strict-concurrency=targeted
// RUN: %target-swift-frontend -disable-availability-checking %s -emit-sil -o /dev/null -verify -strict-concurrency=complete
// RUN: %target-swift-frontend -disable-availability-checking %s -emit-sil -o /dev/null -verify -strict-concurrency=complete -enable-upcoming-feature RegionBasedIsolation
// REQUIRES: concurrency
// REQUIRES: asserts
// REQUIRES: libdispatch
@available(SwiftStdlib 5.1, *)
@rethrows
protocol TGP: AsyncSequence, AsyncIteratorProtocol { }
@available(SwiftStdlib 5.1, *)
extension TaskGroup: TGP { }
// expected-warning@-1{{extension declares a conformance of imported type 'TaskGroup' to imported protocol 'AsyncIteratorProtocol'}}
// expected-note@-2{{add '@retroactive' to silence this warning}}
@available(SwiftStdlib 5.1, *)
extension ThrowingTaskGroup: TGP { }
// expected-warning@-1{{extension declares a conformance of imported type 'ThrowingTaskGroup' to imported protocol 'AsyncIteratorProtocol'}}
// expected-note@-2{{add '@retroactive' to silence this warning}}