“Key conforms to Hashable” annotation in Dictionary documentation

I just noticed that the documentation page for Dictionary has many properties/methods annotated with “Available when Key conforms to Hashable.” For example:

var isEmpty: Bool

A Boolean value that indicates whether the dictionary is empty.

Available when Key conforms to Hashable.

That does not make much sense to me, since Dictionary.Key always conforms to the Hashable protocol.

I am curious why this is explicitly mentioned for many (but not for all) properties/methods.

Regards, Martin

7 Likes