Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TSCBasic: fix compatibility with Swift 5.5 #415

Merged
merged 3 commits into from
May 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions Sources/TSCBasic/FileSystem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1029,7 +1029,11 @@ public final class InMemoryFileSystem: FileSystem {
}

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

/// A rerooted view on an existing FileSystem.
///
Expand Down Expand Up @@ -1184,7 +1188,11 @@ public final class RerootedFileSystemView: FileSystem {

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

private var _localFileSystem: FileSystem = LocalFileSystem()

Expand Down