Skip to content

Commit b198806

Browse files
authored
Fix InternalImportsByDefault diagnostics in _AsyncFileSystem (#7895)
Address some `InternalImportsByDefault` diagnostics in the `_AsyncFileSystem` which have crept in because the Swift 6 toolchain isn't enforcing `.enableExperimentalFeature("InternalImportsByDefault")`. ### Motivation: Both the `StrictConcurrency` and `InternalImportsByDefault` features became "upcoming" features instead of "experimental" features in the Swift 6 compiler. This means that specifying those features with `.enableExperimentalFeature()` no longer works with newer toolchains, and therefore these settings in SwiftPM's `Package.swift` have become inactive. I'm making the compiler more lenient, so that `-enable-experimental-feature` will enable the corresponding upcoming feature if relevant (swiftlang/swift#75962) but in the meantime it appears that some of the code in SwiftPM needs some fixes to continue to be accepted by the compiler with these features on. ### Modifications: Adjusted access level on a number of import statements in files belonging to the `_AsyncFileSystem` target. ### Result: `_AsyncFileSystem` builds successfully when `InternalImportsByDefault` is actually enabled with the Swift 6 toolchain.
1 parent 520d11a commit b198806

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

Sources/_AsyncFileSystem/AsyncFileSystem.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
import protocol _Concurrency.Actor
14-
@preconcurrency import struct SystemPackage.Errno
15-
@preconcurrency import struct SystemPackage.FilePath
14+
@preconcurrency package import struct SystemPackage.Errno
15+
@preconcurrency package import struct SystemPackage.FilePath
1616

1717
/// An abstract file system protocol with first-class support for Swift Concurrency.
1818
package protocol AsyncFileSystem: Actor {

Sources/_AsyncFileSystem/MockFileSystem.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
@preconcurrency import struct SystemPackage.FilePath
13+
@preconcurrency package import struct SystemPackage.FilePath
1414

1515
/// In-memory implementation of `AsyncFileSystem` for mocking and testing purposes.
1616
package actor MockFileSystem: AsyncFileSystem {

Sources/_AsyncFileSystem/OpenReadableFile.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
internal import class Dispatch.DispatchQueue
14-
import struct SystemPackage.FileDescriptor
14+
internal import struct SystemPackage.FileDescriptor
1515

1616
/// A read-only thread-safe handle to an open file.
1717
package struct OpenReadableFile: Sendable {

Sources/_AsyncFileSystem/OpenWritableFile.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
internal import class Dispatch.DispatchQueue
14-
@preconcurrency import struct SystemPackage.FileDescriptor
15-
import struct SystemPackage.FilePath
14+
@preconcurrency internal import struct SystemPackage.FileDescriptor
15+
internal import struct SystemPackage.FilePath
1616

1717
/// A write-only thread-safe handle to an open file.
1818
package actor OpenWritableFile: WritableStream {

Sources/_AsyncFileSystem/ReadableFileStream.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
import _Concurrency
14-
import SystemPackage
14+
internal import SystemPackage
1515
internal import class Dispatch.DispatchQueue
1616

1717
/// Type-erasure wrapper over underlying file system readable streams.

0 commit comments

Comments
 (0)