Skip to content

Commit 5736e59

Browse files
committed
Remove @_implementationOnly annotations
These annotations produce warnings when compiling swift-syntax without library evolution using Swift ≥5.10. Replace them by `private import` when compiling using Swift ≥5.11. Mirrors swiftlang/swift-syntax#2429
1 parent a0f43bb commit 5736e59

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

Sources/ArgumentParser/Usage/DumpHelpGenerator.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,13 @@
99
//
1010
//===----------------------------------------------------------------------===//
1111

12-
@_implementationOnly import ArgumentParserToolInfo
13-
@_implementationOnly import class Foundation.JSONEncoder
12+
#if swift(>=5.11)
13+
private import ArgumentParserToolInfo
14+
private import class Foundation.JSONEncoder
15+
#else
16+
import ArgumentParserToolInfo
17+
import class Foundation.JSONEncoder
18+
#endif
1419

1520
internal struct DumpHelpGenerator {
1621
var toolInfo: ToolInfoV0

Sources/ArgumentParser/Usage/MessageInfo.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,13 @@
99
//
1010
//===----------------------------------------------------------------------===//
1111

12-
@_implementationOnly import protocol Foundation.LocalizedError
13-
@_implementationOnly import class Foundation.NSError
12+
#if swift(>=5.11)
13+
private import protocol Foundation.LocalizedError
14+
private import class Foundation.NSError
15+
#else
16+
import protocol Foundation.LocalizedError
17+
import class Foundation.NSError
18+
#endif
1419

1520
enum MessageInfo {
1621
case help(text: String)

Sources/ArgumentParser/Usage/UsageGenerator.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@
99
//
1010
//===----------------------------------------------------------------------===//
1111

12-
@_implementationOnly import protocol Foundation.LocalizedError
12+
#if swift(>=5.11)
13+
private import protocol Foundation.LocalizedError
14+
#else
15+
import protocol Foundation.LocalizedError
16+
#endif
1317

1418
struct UsageGenerator {
1519
var toolName: String

0 commit comments

Comments
 (0)