Skip to content

Commit 9ca6896

Browse files
committed
Fix retroactive conformance warnings for 6.0+ compilers (#7605)
`#if swift(<6.0)` is a wrong check to apply, since it has no effect with 6.0 compiler versions, unlike `#if compiler(<6.0)`. (cherry picked from commit 067136b)
1 parent 3bbca26 commit 9ca6896

File tree

11 files changed

+11
-11
lines changed

11 files changed

+11
-11
lines changed

Sources/Commands/PackageCommands/Init.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ extension SwiftPackageCommand {
8080
}
8181
}
8282

83-
#if swift(<6.0)
83+
#if compiler(<6.0)
8484
extension InitPackage.PackageType: ExpressibleByArgument {}
8585
#else
8686
extension InitPackage.PackageType: @retroactive ExpressibleByArgument {}

Sources/Commands/Utilities/APIDigester.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ extension SerializedDiagnostics.SourceLocation {
328328
}
329329
}
330330

331-
#if swift(<6.0)
331+
#if compiler(<6.0)
332332
extension SerializedDiagnostics.SourceLocation: DiagnosticLocation {}
333333
#else
334334
extension SerializedDiagnostics.SourceLocation: @retroactive DiagnosticLocation {}

Sources/CoreCommands/Options.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ extension URL {
721721
}
722722
}
723723

724-
#if swift(<6.0)
724+
#if compiler(<6.0)
725725
extension BuildConfiguration: ExpressibleByArgument {}
726726
extension AbsolutePath: ExpressibleByArgument {}
727727
extension WorkspaceConfiguration.CheckingMode: ExpressibleByArgument {}

Sources/PackageRegistryCommand/PackageRegistryCommand+Publish.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ extension SignatureFormat {
247247
}
248248
}
249249

250-
#if swift(<6.0)
250+
#if compiler(<6.0)
251251
extension SignatureFormat: ExpressibleByArgument {}
252252
#else
253253
extension SignatureFormat: @retroactive ExpressibleByArgument {}

Sources/SPMTestSupport/misc.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ extension InitPackage {
488488
}
489489
}
490490

491-
#if swift(<6.0)
491+
#if compiler(<6.0)
492492
extension RelativePath: ExpressibleByStringLiteral {}
493493
extension RelativePath: ExpressibleByStringInterpolation {}
494494
extension URL: ExpressibleByStringLiteral {}

Sources/Workspace/Diagnostics.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ extension FileSystemError {
247247
}
248248
}
249249

250-
#if swift(<6.0)
250+
#if compiler(<6.0)
251251
extension FileSystemError: CustomStringConvertible {}
252252
#else
253253
extension FileSystemError: @retroactive CustomStringConvertible {}

Sources/Workspace/Workspace.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1472,7 +1472,7 @@ private func warnToStderr(_ message: String) {
14721472
}
14731473

14741474
// used for manifest validation
1475-
#if swift(<6.0)
1475+
#if compiler(<6.0)
14761476
extension RepositoryManager: ManifestSourceControlValidator {}
14771477
#else
14781478
extension RepositoryManager: @retroactive ManifestSourceControlValidator {}

Sources/swift-bootstrap/main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ extension BuildConfiguration {
485485
}
486486
}
487487

488-
#if swift(<6.0)
488+
#if compiler(<6.0)
489489
extension AbsolutePath: ExpressibleByArgument {}
490490
extension BuildConfiguration: ExpressibleByArgument {}
491491
#else

Tests/PackageGraphPerformanceTests/DependencyResolverPerfTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ extension ProductFilter {
201201
}
202202
}
203203

204-
#if swift(<6.0)
204+
#if compiler(<6.0)
205205
extension ProductFilter: JSONSerializable, JSONMappable {}
206206
#else
207207
extension ProductFilter: @retroactive JSONSerializable, @retroactive JSONMappable {}

Tests/PackageGraphTests/PubgrubTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3802,7 +3802,7 @@ extension PackageReference {
38023802
}
38033803
}
38043804

3805-
#if swift(<6.0)
3805+
#if compiler(<6.0)
38063806
extension Term: ExpressibleByStringLiteral {}
38073807
extension PackageReference: ExpressibleByStringLiteral {}
38083808
#else

Tests/PackageGraphTests/TopologicalSortTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ extension Int {
3434
public var id: Self { self }
3535
}
3636

37-
#if swift(<6.0)
37+
#if compiler(<6.0)
3838
extension Int: Identifiable {}
3939
#else
4040
extension Int: @retroactive Identifiable {}

0 commit comments

Comments
 (0)