Skip to content

Commit fd8ea09

Browse files
authored
Remove @_implementationOnly imports (#666)
The `@_implementationOnly` attribute does not work correctly without library evolution enabled. The only possible client with this enabled is Apple, however they have updated to the Swift 6 compiler and can use `internal import` instead of this attribute. Therefore there is no need for this package to use the attribute anymore.
1 parent 23d8d3a commit fd8ea09

File tree

5 files changed

+9
-21
lines changed

5 files changed

+9
-21
lines changed

Sources/ArgumentParser/Parsing/CommandParser.swift

+1-3
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@
1111

1212
#if swift(>=5.11)
1313
internal import class Foundation.ProcessInfo
14-
#elseif swift(>=5.10)
15-
import class Foundation.ProcessInfo
1614
#else
17-
@_implementationOnly import class Foundation.ProcessInfo
15+
import class Foundation.ProcessInfo
1816
#endif
1917

2018
struct CommandError: Error {

Sources/ArgumentParser/Usage/DumpHelpGenerator.swift

+2-5
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,12 @@
99
//
1010
//===----------------------------------------------------------------------===//
1111

12-
#if swift(>=5.11)
12+
#if swift(>=6.0)
1313
internal import ArgumentParserToolInfo
1414
internal import class Foundation.JSONEncoder
15-
#elseif swift(>=5.10)
15+
#else
1616
import ArgumentParserToolInfo
1717
import class Foundation.JSONEncoder
18-
#else
19-
@_implementationOnly import ArgumentParserToolInfo
20-
@_implementationOnly import class Foundation.JSONEncoder
2118
#endif
2219

2320
internal struct DumpHelpGenerator {

Sources/ArgumentParser/Usage/MessageInfo.swift

+2-5
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,12 @@
99
//
1010
//===----------------------------------------------------------------------===//
1111

12-
#if swift(>=5.11)
12+
#if swift(>=6.0)
1313
internal import protocol Foundation.LocalizedError
1414
internal import class Foundation.NSError
15-
#elseif swift(>=5.10)
15+
#else
1616
import protocol Foundation.LocalizedError
1717
import class Foundation.NSError
18-
#else
19-
@_implementationOnly import protocol Foundation.LocalizedError
20-
@_implementationOnly import class Foundation.NSError
2118
#endif
2219

2320
enum MessageInfo {

Sources/ArgumentParser/Usage/UsageGenerator.swift

+2-4
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@
99
//
1010
//===----------------------------------------------------------------------===//
1111

12-
#if swift(>=5.11)
12+
#if swift(>=6.0)
1313
internal import protocol Foundation.LocalizedError
14-
#elseif swift(>=5.10)
15-
import protocol Foundation.LocalizedError
1614
#else
17-
@_implementationOnly import protocol Foundation.LocalizedError
15+
import protocol Foundation.LocalizedError
1816
#endif
1917

2018
struct UsageGenerator {

Sources/ArgumentParser/Utilities/Mutex.swift

+2-4
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@
99
//
1010
//===----------------------------------------------------------------------===//
1111

12-
#if swift(>=5.11)
12+
#if swift(>=6.0)
1313
internal import Foundation
14-
#elseif swift(>=5.10)
15-
import Foundation
1614
#else
17-
@_implementationOnly import Foundation
15+
import Foundation
1816
#endif
1917

2018
/// A synchronization primitive that protects shared mutable state via mutual

0 commit comments

Comments
 (0)