Skip to content

Commit 316f686

Browse files
authored
Merge pull request #73431 from DougGregor/task-group-next-public-6.0
2 parents 1420ee7 + 47ae22d commit 316f686

File tree

3 files changed

+26
-14
lines changed

3 files changed

+26
-14
lines changed

stdlib/public/Concurrency/TaskGroup.swift

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -574,10 +574,9 @@ public struct TaskGroup<ChildTaskResult: Sendable> {
574574
return try! await _taskGroupWaitNext(group: _group) // !-safe cannot throw, we're a non-throwing TaskGroup
575575
}
576576

577-
@usableFromInline
578577
@available(SwiftStdlib 5.1, *)
579-
@_silgen_name("$sScG4nextxSgyYaF")
580-
internal mutating func __abi_next() async -> ChildTaskResult? {
578+
@_disfavoredOverload
579+
public mutating func next() async -> ChildTaskResult? {
581580
// try!-safe because this function only exists for Failure == Never,
582581
// and as such, it is impossible to spawn a throwing child task.
583582
return try! await _taskGroupWaitNext(group: _group) // !-safe cannot throw, we're a non-throwing TaskGroup
@@ -1035,10 +1034,9 @@ public struct ThrowingTaskGroup<ChildTaskResult: Sendable, Failure: Error> {
10351034
return try await _taskGroupWaitNext(group: _group)
10361035
}
10371036

1038-
@usableFromInline
10391037
@available(SwiftStdlib 5.1, *)
1040-
@_silgen_name("$sScg4nextxSgyYaKF")
1041-
internal mutating func __abi_next() async throws -> ChildTaskResult? {
1038+
@_disfavoredOverload
1039+
public mutating func next() async throws -> ChildTaskResult? {
10421040
return try await _taskGroupWaitNext(group: _group)
10431041
}
10441042

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// RUN: %target-swift-frontend -disable-availability-checking %s -emit-sil -o /dev/null -verify
2+
// RUN: %target-swift-frontend -disable-availability-checking %s -emit-sil -o /dev/null -verify -strict-concurrency=targeted
3+
// RUN: %target-swift-frontend -disable-availability-checking %s -emit-sil -o /dev/null -verify -strict-concurrency=complete
4+
// RUN: %target-swift-frontend -disable-availability-checking %s -emit-sil -o /dev/null -verify -strict-concurrency=complete -enable-upcoming-feature RegionBasedIsolation
5+
6+
// REQUIRES: concurrency
7+
// REQUIRES: asserts
8+
// REQUIRES: libdispatch
9+
10+
@available(SwiftStdlib 5.1, *)
11+
@rethrows
12+
protocol TGP: AsyncSequence, AsyncIteratorProtocol { }
13+
14+
@available(SwiftStdlib 5.1, *)
15+
extension TaskGroup: TGP { }
16+
// expected-warning@-1{{extension declares a conformance of imported type 'TaskGroup' to imported protocol 'AsyncIteratorProtocol'}}
17+
// expected-note@-2{{add '@retroactive' to silence this warning}}
18+
19+
@available(SwiftStdlib 5.1, *)
20+
extension ThrowingTaskGroup: TGP { }
21+
// expected-warning@-1{{extension declares a conformance of imported type 'ThrowingTaskGroup' to imported protocol 'AsyncIteratorProtocol'}}
22+
// expected-note@-2{{add '@retroactive' to silence this warning}}

test/api-digester/stability-concurrency-abi.test

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,6 @@ Func TaskLocal.withValue(_:operation:file:line:) has parameter 1 type change fro
112112
Func TaskLocal.withValue(_:operation:file:line:) has parameter 2 type change from Swift.String to (any _Concurrency.Actor)?
113113
Func TaskLocal.withValue(_:operation:file:line:) has parameter 3 type change from Swift.UInt to Swift.String
114114

115-
// The method is actually still there: '__abi_next' silgen_name("$sScG4nextxSgyYaF")
116-
Func TaskGroup.next() has been renamed to Func next(isolation:)
117-
Func TaskGroup.next() has mangled name changing from 'Swift.TaskGroup.next() async -> Swift.Optional<A>' to 'Swift.TaskGroup.next(isolation: isolated Swift.Optional<Swift.Actor>) async -> Swift.Optional<A>'
118-
119-
// The method is actually still there: '__abi_next' silgen_name("$sScg4nextxSgyYaKF")
120-
Func ThrowingTaskGroup.next() has been renamed to Func next(isolation:)
121-
Func ThrowingTaskGroup.next() has mangled name changing from 'Swift.ThrowingTaskGroup.next() async throws -> Swift.Optional<A>' to 'Swift.ThrowingTaskGroup.next(isolation: isolated Swift.Optional<Swift.Actor>) async throws -> Swift.Optional<A>'
122-
123115
// *** DO NOT DISABLE OR XFAIL THIS TEST. *** (See comment above.)
124116

125117

0 commit comments

Comments
 (0)