mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Allow "incomplete hashing" when testing ObjC bridged objects
Swift objects can implement Equatable without implementing Hashable. Obj-C NSObject always provides both. Now that we bridge Swift Equatable to Obj-C `-isEqual:`, we have to be conservative with how we expose `-hash` for Swift types that are Equatable but not Hashable. This looks like "incomplete hashing" of such types.
This commit is contained in:
@@ -346,7 +346,7 @@ BridgeAnything.test("SwiftValue(mixed values)/Hashable") {
|
||||
}
|
||||
return lhs / 2 == rhs / 2
|
||||
}
|
||||
checkHashable(boxedXs, equalityOracle: equalityOracle)
|
||||
checkHashable(boxedXs, equalityOracle: equalityOracle, allowIncompleteHashing: true)
|
||||
}
|
||||
|
||||
runAllTests()
|
||||
|
||||
Reference in New Issue
Block a user