Skip to content

Commit 2000bf9

Browse files
committed
Add @_implicitSelfCapture to asyncDetached.
Like `async`, `asyncDetached` should not require `self.` because it is unlikely to introduce cycles.
1 parent 8447424 commit 2000bf9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stdlib/public/Concurrency/Task.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ public func detach<T>(
442442
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
443443
public func asyncDetached<T>(
444444
priority: Task.Priority = .unspecified,
445-
operation: __owned @Sendable @escaping () async -> T
445+
@_implicitSelfCapture operation: __owned @Sendable @escaping () async -> T
446446
) -> Task.Handle<T, Never> {
447447
return detach(priority: priority, operation: operation)
448448
}
@@ -452,7 +452,7 @@ public func asyncDetached<T>(
452452
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
453453
public func asyncDetached<T>(
454454
priority: Task.Priority = .unspecified,
455-
operation: __owned @Sendable @escaping () async throws -> T
455+
@_implicitSelfCapture operation: __owned @Sendable @escaping () async throws -> T
456456
) -> Task.Handle<T, Error> {
457457
return detach(priority: priority, operation: operation)
458458
}

0 commit comments

Comments
 (0)