[SR-5819] Suggest as? AnyHashable
when as? Equatable
or as? Hashable
is attempted
#48389
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler itself
diagnostics QoI
Bug: Diagnostics Quality of Implementation
good first issue
Good for newcomers
Additional Detail from JIRA
md5: 5e4ffb6d40f711123adf86651f9a3a8f
Issue Description:
If you have two values of type
Any
or otherwise opaque type and you want to test whether they're equal, it's natural to try to write something like:Maybe someday that will work, but in the meantime dynamically casting to
AnyHashable
can get the desired effect. It'd be nice QoI to have a diagnostic telling people they can do this when they try similar things that don't.The text was updated successfully, but these errors were encountered: