Skip to content

Commit 002abb5

Browse files
committed
[concurrency] Deprecate some source compatibility APIs in swift 5 and obsolete in swift 6.
These APIs remained to preserve source compatibility during bringup. We do not want them used in swift 6 mode... so deprecate in swift 5 and obsolete in swift 6.
1 parent 89fd614 commit 002abb5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

stdlib/public/Concurrency/Task.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,8 @@ extension Task where Failure == Error {
255255
@_spi(MainActorUtilities)
256256
@MainActor
257257
@available(SwiftStdlib 5.9, *)
258+
@available(*, deprecated, message: "Use Task.init with a main actor isolated closure instead")
259+
@available(swift, obsoleted: 6.0, message: "Use Task.init with a main actor isolated closure instead")
258260
@discardableResult
259261
public static func startOnMainActor(
260262
priority: TaskPriority? = nil,
@@ -278,6 +280,8 @@ extension Task where Failure == Never {
278280
@_spi(MainActorUtilities)
279281
@MainActor
280282
@available(SwiftStdlib 5.9, *)
283+
@available(*, deprecated, message: "Use Task.init with a main actor isolated closure instead")
284+
@available(swift, obsoleted: 6.0, message: "Use Task.init with a main actor isolated closure instead")
281285
@discardableResult
282286
public static func startOnMainActor(
283287
priority: TaskPriority? = nil,

0 commit comments

Comments
 (0)