Commit Graph

2 Commits

Author SHA1 Message Date
John Hui
493d37e776 [cxx-interop] Fix hashable-enums test (#77053)
The hash of enum values are different from that of their underlying
rawValue due to the implementation details of Int on 64-bit platform
which are not true on 32-bit platforms. This commit removes the tests
that rely on this behavior.

rdar://138032645
2024-10-16 13:52:38 -07:00
John Hui
b58a908082 [cxx-interop] Add Hashable conformance to imported enums (#76940)
* [cxx-interop] Add Hashable conformance to imported enums

Previously, imported enums only conformed to RawRepresentable and Equatable,
so they could not be used as members of a Set or keys of a Dictionary.
This patch adds Hashable conformance to give them that ability,
as well as some test cases to clarify the expected behavior.
Existing test cases are updated to reflect this new conformance.

rdar://129713687
2024-10-15 20:24:35 -07:00