[test] Confess that Unmanaged’s hacky Equatable conformance is retroactive

This commit is contained in:
Karoy Lorentey committed 2025-06-03 19:23:56 -07:00
1 parent 581fb9e875
commit cae5c18207
1 file changed
+9 -1
@@ -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