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:
Tim Kientzle
2023-10-31 11:37:10 -07:00
parent 6fd39741d6
commit 8cc0fe73d7

View File

@@ -346,7 +346,7 @@ BridgeAnything.test("SwiftValue(mixed values)/Hashable") {
} }
return lhs / 2 == rhs / 2 return lhs / 2 == rhs / 2
} }
checkHashable(boxedXs, equalityOracle: equalityOracle) checkHashable(boxedXs, equalityOracle: equalityOracle, allowIncompleteHashing: true)
} }
runAllTests() runAllTests()