Skip to content

Commit a8ffbdf

Browse files
committed
Retroactively conform DispatchData to Sendable when building with older macOS SDKs in Swift CI
1 parent ec2e9fa commit a8ffbdf

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

Sources/Subprocess/IO/AsyncIO+Dispatch.swift

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,16 @@ final class AsyncIO: Sendable {
166166
}
167167
}
168168

169-
#if !canImport(Darwin)
169+
#if canImport(Darwin)
170+
// Dispatch has a -user-module-version of 54 in the macOS 15.3 SDK
171+
#if canImport(Dispatch, _version: "54")
172+
// DispatchData is annotated as Sendable
173+
#else
174+
// Retroactively conform DispatchData to Sendable
170175
extension DispatchData: @retroactive @unchecked Sendable {}
171-
#endif
176+
#endif // canImport(Dispatch, _version: "54")
177+
#else
178+
extension DispatchData: @retroactive @unchecked Sendable {}
179+
#endif // canImport(Darwin)
172180

173-
#endif
181+
#endif // SUBPROCESS_ASYNCIO_DISPATCH

0 commit comments

Comments
 (0)