Skip to content

Commit 24c3dbd

Browse files
committed
Replace #if swift(>=6.0) guards with #if compiler(>=6.0).
All uses of `internal import` were previously garuded with `#if swift(>=6.0)`, presumably to handle differences in compiler support for `internal import`. However, `#if swift(>=)` is not the correct directive to use for this purpose, as it primarily tests the language mode that is enabled. These existing conditionals never evaluated true when building this package since it is not configured to build with Swift 6 enabled. Instead, use `#if compiler(>=6.0)` which correctly predicates the imports on only the compiler version.
1 parent 0a2f3bc commit 24c3dbd

File tree

12 files changed

+12
-17
lines changed

12 files changed

+12
-17
lines changed

Sources/ArgumentParser/Completions/BashCompletionsGenerator.swift

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

12-
#if swift(>=6.0)
12+
#if compiler(>=6.0)
1313
internal import ArgumentParserToolInfo
1414
#else
1515
import ArgumentParserToolInfo

Sources/ArgumentParser/Completions/CompletionsGenerator.swift

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

12-
#if swift(>=6.0)
12+
#if compiler(>=6.0)
1313
internal import ArgumentParserToolInfo
1414
internal import Foundation
1515
#else

Sources/ArgumentParser/Completions/FishCompletionsGenerator.swift

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

12-
#if swift(>=6.0)
12+
#if compiler(>=6.0)
1313
internal import ArgumentParserToolInfo
1414
internal import Foundation
1515
#else

Sources/ArgumentParser/Completions/ZshCompletionsGenerator.swift

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

12-
#if swift(>=6.0)
12+
#if compiler(>=6.0)
1313
internal import ArgumentParserToolInfo
1414
internal import Foundation
1515
#else

Sources/ArgumentParser/Parsable Types/ParsableArguments.swift

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

12-
#if swift(>=6.0)
12+
#if compiler(>=6.0)
1313
internal import Foundation
1414
#else
1515
import Foundation

Sources/ArgumentParser/Parsing/CommandParser.swift

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

12-
#if swift(>=6.0)
12+
#if compiler(>=6.0)
1313
#if canImport(Dispatch)
1414
@preconcurrency private import class Dispatch.DispatchSemaphore
1515
#endif

Sources/ArgumentParser/Usage/DumpHelpGenerator.swift

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

12-
#if swift(>=6.0)
12+
#if compiler(>=6.0)
1313
internal import ArgumentParserToolInfo
1414
internal import class Foundation.JSONEncoder
1515
#else

Sources/ArgumentParser/Usage/MessageInfo.swift

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

12-
#if swift(>=6.0)
12+
#if compiler(>=6.0)
1313
internal import protocol Foundation.LocalizedError
1414
internal import class Foundation.NSError
1515
#else

Sources/ArgumentParser/Usage/UsageGenerator.swift

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

12-
#if swift(>=6.0)
12+
#if compiler(>=6.0)
1313
internal import protocol Foundation.LocalizedError
1414
#else
1515
import protocol Foundation.LocalizedError

Sources/ArgumentParser/Utilities/Mutex.swift

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

12-
#if swift(>=6.0)
12+
#if compiler(>=6.0)
1313
internal import Foundation
1414
#else
1515
import Foundation

0 commit comments

Comments
 (0)