Include explicit Hashable/Equatable for test class

This commit is contained in:
Tim Kientzle
2023-02-07 14:21:28 -08:00
parent f7ab029d51
commit 50745047e9

View File

@@ -1037,7 +1037,10 @@ CastsTests.test("Do not overuse __SwiftValue (non-ObjC)") {
}
CastsTests.test("Don't put AnyHashable inside AnyObject") {
class C: Hashable {}
class C: Hashable {
func hash(into hasher: inout Hasher) {}
static func ==(lhs: C, rhs: C) -> Bool { true }
}
let a = C()
let b = AnyHashable(a)
let c = a as! AnyObject