mirror of
https://github.com/apple/swift-atomics
synced 2026-11-22 04:20:39 +00:00
[test] Confess that Unmanaged’s hacky Equatable conformance is retroactive
This commit is contained in:
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
|
||||
|
||||
Reference in new issue
Block a user