Skip to content

Commit 067136b

Browse files
authored
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)`.
1 parent 2bedcc4 commit 067136b

File tree

11 files changed

+11
-11
lines changed

11 files changed

+11
-11
lines changed

Sources/Commands/PackageCommands/Init.swift

+1-1
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

+1-1
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

+1-1
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ extension URL {
720720
}
721721
}
722722

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

Sources/PackageRegistryCommand/PackageRegistryCommand+Publish.swift

+1-1
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

+1-1
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ extension InitPackage {
446446
}
447447
}
448448

449-
#if swift(<6.0)
449+
#if compiler(<6.0)
450450
extension RelativePath: ExpressibleByStringLiteral {}
451451
extension RelativePath: ExpressibleByStringInterpolation {}
452452
extension URL: ExpressibleByStringLiteral {}

Sources/Workspace/Diagnostics.swift

+1-1
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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1480,7 +1480,7 @@ private func warnToStderr(_ message: String) {
14801480
}
14811481

14821482
// used for manifest validation
1483-
#if swift(<6.0)
1483+
#if compiler(<6.0)
14841484
extension RepositoryManager: ManifestSourceControlValidator {}
14851485
#else
14861486
extension RepositoryManager: @retroactive ManifestSourceControlValidator {}

Sources/swift-bootstrap/main.swift

+1-1
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

+1-1
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

+1-1
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

+1-1
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)