Skip to content

Commit 95d84d6

Browse files
committed
Allow a Swift 5.5 compiler to process the new _Concurrency module.
Swift 5.5 does not implement support for structural types that are Sendable, which breaks type checking of the newer _Concurrency module. Work around the issue with an `#if` in the offending inline code. Fixes rdar://82602353.
1 parent 8cba09a commit 95d84d6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

stdlib/public/Concurrency/Task.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,14 @@ func _getCurrentThreadPriority() -> Int
824824
@_alwaysEmitIntoClient
825825
@usableFromInline
826826
internal func _runTaskForBridgedAsyncMethod(@_inheritActorContext _ body: __owned @Sendable @escaping () async -> Void) {
827+
#if compiler(>=5.6)
827828
Task(operation: body)
829+
#else
830+
Task<Int, Error> {
831+
await body()
832+
return 0
833+
}
834+
#endif
828835
}
829836

830837
#endif

0 commit comments

Comments
 (0)