From my findings, the only thing holding this back is Unlock Existential Types for All Protocols. There's simply no way to tell the compiler that some arbitrary superclass type conforms to Equatable without being able to do something like as! Equatable
or if let type = superclassType as? Equatable.Type
. Once we have that, being able to write AnyHashable
or AnyEquatable
in pure Swift will be possible, albeit with a little reflection help.