# Make types Hashable

**URL:** <https://forums.swift.org/t/make-types-hashable/38837>\
**Category:** Discussion\
**Created:** [July 28, 2020, 8:37pm UTC](https://forums.swift.org/t/make-types-hashable/38837 "2020-07-28T20:37:57Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![Nickolas\_Pohilets](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/nickolas_pohilets/32/10659_2.png) [@Nickolas\_Pohilets](https://forums.swift.org/u/Nickolas_Pohilets)\
**Post date:** [August 20, 2021, 9:30pm UTC](https://forums.swift.org/t/make-types-hashable/38837/7 "2021-08-20T21:30:47Z")

</div>

I would love one day to make a huge breaking change and implement [Universal Equality and Hashability](https://forums.swift.org/t/universal-equatability-hashability-and-comparability/1718):

1. Provide global `func ==<T>(lhs: T, rhs: T)` handling any type, including meta types, tuples, existential containers and functions. Similar for hashing.
2. Move equality and hashability witness to VWT.
3. Replace `Equatable`/`Hashable` with `CustomEquatable`/`CustomHashable` similar to `CustomStringConvertible` and `CustomReflectable`.
4. Drop `===` and use `==` to compare references. Disallow classes to conform to `CustomEquatable`/`CustomHashable`.

Reasoning for the last one - if reference equality is not what you need, then your entity should not be modeled as a reference type, but rather a value type that uses heap allocation as its implementation detail.

**EDIT:**

1. And it also requires stable weak reference - currently references to zombie side tables are dropped during copying.

---

_[View the full topic](https://forums.swift.org/t/make-types-hashable/38837)._
