Skip to content

Commit 9788cc2

Browse files
committed
[Concurrency] Provide an alternative implementation when "async { }" is unusable
There exist Swift builds that support `Sendable` but not the attributes used on `async`. Make sure that have an implementation of `_runTaskForBridgedAsyncMethod` that does something. Fixes rdar://77637570.
1 parent 1f005e1 commit 9788cc2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

stdlib/public/Concurrency/Task.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -831,8 +831,10 @@ func _getCurrentThreadPriority() -> Int
831831
@_alwaysEmitIntoClient
832832
@usableFromInline
833833
internal func _runTaskForBridgedAsyncMethod(_ body: @escaping () async -> Void) {
834-
#if compiler(>=5.5) && $Sendable
834+
#if compiler(>=5.5) && $Sendable && $InheritActorContext && $ImplicitSelfCapture
835835
async { await body() }
836+
#else
837+
detach { await body() }
836838
#endif
837839
}
838840

0 commit comments

Comments
 (0)