From 3da4d9375464349f570087923b8299b1342b9c32 Mon Sep 17 00:00:00 2001 From: Dimitri Bouniol Date: Wed, 19 Jun 2024 02:43:32 -0700 Subject: [PATCH] Updated UUID's Comparable conformance to be disfavored over Foundation's --- Sources/CodableDatastore/Indexes/UUID+Comparable.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sources/CodableDatastore/Indexes/UUID+Comparable.swift b/Sources/CodableDatastore/Indexes/UUID+Comparable.swift index 4b98cf5..7bc9ac9 100644 --- a/Sources/CodableDatastore/Indexes/UUID+Comparable.swift +++ b/Sources/CodableDatastore/Indexes/UUID+Comparable.swift @@ -8,11 +8,12 @@ import Foundation +/// Make UUIDs comparable on platforms that shipped without it, so that they can be used transparently as an index. #if swift(<5.9) || os(macOS) || os(iOS) || os(tvOS) || os(watchOS) || os(Linux) || os(Windows) -/// Make UUIDs comparable, so that they can be used transparently as an index. #if compiler(>=6) extension UUID: @retroactive Comparable { @inlinable + @_disfavoredOverload public static func < (lhs: UUID, rhs: UUID) -> Bool { lhs.isLessThan(rhs: rhs) } @@ -20,6 +21,7 @@ extension UUID: @retroactive Comparable { #else extension UUID: Comparable { @inlinable + @_disfavoredOverload public static func < (lhs: UUID, rhs: UUID) -> Bool { lhs.isLessThan(rhs: rhs) }