@@ -75,7 +75,7 @@ extension SocketAddressError {
75
75
public enum SocketAddress : CustomStringConvertible , NIOSendable {
76
76
77
77
/// A single IPv4 address for `SocketAddress`.
78
- public struct IPv4Address : NIOSendable {
78
+ public struct IPv4Address {
79
79
private let _storage : Box < ( address: sockaddr_in , host: String ) >
80
80
81
81
/// The libc socket address for an IPv4 address.
@@ -90,7 +90,7 @@ public enum SocketAddress: CustomStringConvertible, NIOSendable {
90
90
}
91
91
92
92
/// A single IPv6 address for `SocketAddress`.
93
- public struct IPv6Address : NIOSendable {
93
+ public struct IPv6Address {
94
94
private let _storage : Box < ( address: sockaddr_in6 , host: String ) >
95
95
96
96
/// The libc socket address for an IPv6 address.
@@ -560,6 +560,16 @@ extension SocketAddress: Equatable {
560
560
}
561
561
}
562
562
563
+ #if compiler(>=5.5.2)
564
+ extension SocketAddress . IPv4Address : Sendable { }
565
+ extension SocketAddress . IPv6Address : Sendable { }
566
+ #elseif compiler(>=5.5)
567
+ // Implicit conformance of tuples to Sendable interacts poorly with conditional conformance of Sendable in Swift <=5.5.1
568
+ // https://github.com/apple/swift/issues/57346
569
+ extension SocketAddress . IPv4Address : @unchecked Sendable { }
570
+ extension SocketAddress . IPv6Address : @unchecked Sendable { }
571
+ #endif
572
+
563
573
/// We define an extension on `SocketAddress` that gives it an elementwise hashable conformance, using
564
574
/// only the elements defined on the structure in their man pages (excluding lengths).
565
575
extension SocketAddress : Hashable {
0 commit comments