Skip to content

Commit

Permalink
Silence a warning when using Xcode 16/Swift6 toolchain.
Browse files Browse the repository at this point in the history
Without a Package.swift change, the new toolchain is issuing a warning about
needing to flag the `Comparable` conformance as `@retroactive`, so do that.
  • Loading branch information
thomasvl committed Sep 20, 2024
1 parent f386b4a commit 79cd72d
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,16 @@ import SwiftProtobuf

/// The spec for editions calls out them being ordered and comparable.
/// https://github.com/protocolbuffers/protobuf/blob/main/docs/design/editions/edition-naming.md
#if compiler(>=6)
extension Google_Protobuf_Edition: @retroactive Comparable {
public static func < (lhs: Google_Protobuf_Edition, rhs: Google_Protobuf_Edition) -> Bool {
lhs.rawValue < rhs.rawValue
}
}
#else
extension Google_Protobuf_Edition: Comparable {
public static func < (lhs: Google_Protobuf_Edition, rhs: Google_Protobuf_Edition) -> Bool {
lhs.rawValue < rhs.rawValue
}
}
#endif

0 comments on commit 79cd72d

Please sign in to comment.