Skip to content

Commit 1296d2f

Browse files
authored
TSCBasic: fix compatibility with Swift 5.5 (#415)
Some of our CI nodes still support only Swift 5.5 and we should use `UnsafeSendable` with that version instead of `@unchecked Sendable`.
1 parent ee4cb5e commit 1296d2f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Sources/TSCBasic/FileSystem.swift

+8
Original file line numberDiff line numberDiff line change
@@ -1029,7 +1029,11 @@ public final class InMemoryFileSystem: FileSystem {
10291029
}
10301030

10311031
// Internal state of `InMemoryFileSystem` is protected with a lock in all of its `public` methods.
1032+
#if compiler(>=5.7)
10321033
extension InMemoryFileSystem: @unchecked Sendable {}
1034+
#else
1035+
extension InMemoryFileSystem: UnsafeSendable {}
1036+
#endif
10331037

10341038
/// A rerooted view on an existing FileSystem.
10351039
///
@@ -1184,7 +1188,11 @@ public final class RerootedFileSystemView: FileSystem {
11841188

11851189
// `RerootedFileSystemView` doesn't hold any internal state and can be considered `Sendable` since
11861190
// `underlyingFileSystem` is required to be `Sendable`.
1191+
#if compiler(>=5.7)
11871192
extension RerootedFileSystemView: @unchecked Sendable {}
1193+
#else
1194+
extension RerootedFileSystemView: UnsafeSendable {}
1195+
#endif
11881196

11891197
private var _localFileSystem: FileSystem = LocalFileSystem()
11901198

0 commit comments

Comments
 (0)