Skip to content

Commit 8cc0fe7

Browse files
committed
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.
1 parent 6fd3974 commit 8cc0fe7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/stdlib/BridgeIdAsAny.swift.gyb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ BridgeAnything.test("SwiftValue(mixed values)/Hashable") {
346346
}
347347
return lhs / 2 == rhs / 2
348348
}
349-
checkHashable(boxedXs, equalityOracle: equalityOracle)
349+
checkHashable(boxedXs, equalityOracle: equalityOracle, allowIncompleteHashing: true)
350350
}
351351

352352
runAllTests()

0 commit comments

Comments
 (0)