mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Include explicit Hashable/Equatable for test class
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user