Skip to content

Commit de5ea3d

Browse files
authored
Fix Swift 5.5 (#162)
1 parent 330f4ee commit de5ea3d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Sources/NIOTransportServices/NIOTSNetworkEvents.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ public enum NIOTSNetworkEvents {
103103
}
104104
}
105105

106+
// Network.framework has not adopted `Sendable` yet.
107+
// We therefore need to import it with `@preconcurrency`.
108+
// `@preconcurrency` is only available in Swift 5.6.
109+
#if swift(>=5.6)
106110
@available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *)
107111
extension NIOTSNetworkEvents.BetterPathAvailable: Sendable {}
108112
@available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *)
@@ -115,5 +119,6 @@ extension NIOTSNetworkEvents.ConnectToNWEndpoint: Sendable {}
115119
extension NIOTSNetworkEvents.BindToNWEndpoint: Sendable {}
116120
@available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *)
117121
extension NIOTSNetworkEvents.WaitingForConnectivity: Sendable {}
122+
#endif
118123

119124
#endif

0 commit comments

Comments
 (0)