Skip to content

Commit ccf2e66

Browse files
authored
Merge pull request swiftlang#37494 from DougGregor/runTaskForBridgedAsyncMethod-older-compilers-5.5
[Concurrency] Provide an alternative implementation when "async { }" is unusable
2 parents 0731f9e + bcbaf32 commit ccf2e66

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
@@ -945,8 +945,10 @@ func _getCurrentThreadPriority() -> Int
945945
@_alwaysEmitIntoClient
946946
@usableFromInline
947947
internal func _runTaskForBridgedAsyncMethod(_ body: @escaping () async -> Void) {
948-
#if compiler(>=5.5) && $Sendable
948+
#if compiler(>=5.5) && $Sendable && $InheritActorContext && $ImplicitSelfCapture
949949
async { await body() }
950+
#else
951+
detach { await body() }
950952
#endif
951953
}
952954

0 commit comments

Comments
 (0)