From cae5c18207200767ee8ecc13fc7b58e0861bd0de Mon Sep 17 00:00:00 2001 From: Karoy Lorentey Date: Tue, 3 Jun 2025 19:15:38 -0700 Subject: [PATCH] =?UTF-8?q?[test]=20Confess=20that=20Unmanaged=E2=80=99s?= =?UTF-8?q?=20hacky=20Equatable=20conformance=20is=20retroactive?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Tests/AtomicsTests/Basics/BasicTestSupport.swift | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Tests/AtomicsTests/Basics/BasicTestSupport.swift b/Tests/AtomicsTests/Basics/BasicTestSupport.swift index 8758220..765bf6f 100644 --- a/Tests/AtomicsTests/Basics/BasicTestSupport.swift +++ b/Tests/AtomicsTests/Basics/BasicTestSupport.swift @@ -2,7 +2,7 @@ // // This source file is part of the Swift Atomics open source project // -// Copyright (c) 2020 - 2023 Apple Inc. and the Swift project authors +// Copyright (c) 2020 - 2025 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information @@ -12,11 +12,19 @@ import Atomics +#if compiler(>=6.0) +extension Unmanaged: @retroactive Equatable { // FIXME: This is terrible + public static func ==(left: Self, right: Self) -> Bool { + left.toOpaque() == right.toOpaque() + } +} +#else extension Unmanaged: Equatable { // FIXME: This is terrible public static func ==(left: Self, right: Self) -> Bool { left.toOpaque() == right.toOpaque() } } +#endif struct Foo: Equatable, CustomStringConvertible { var value: Int