-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Open
Labels
EquatableArea → standard library: The `Equatable` protocolArea → standard library: The `Equatable` protocolHashableArea → standard library: The `Hashable` protocolArea → standard library: The `Hashable` protocolbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.documentationstandard libraryArea: Standard library umbrellaArea: Standard library umbrella
Description
The Hashable
documentation should be more clear about the exact relationship of the Hashable
and Equatable
protocols. Specifically, the docs should make the expectation that all properties that are included in the ==
implementation are also included in hash(into:)
and vice versa. It would be great if the docs could also discuss what happens if something like a struct property is left out of the Hashable
/Equatable
conformance implementations.
For the Set
type, the docs should describe the requirement for the elements. That is, Hashable
conformance is required and a type's Equatable
is used to determine uniqueness within the set.
Links:
Metadata
Metadata
Assignees
Labels
EquatableArea → standard library: The `Equatable` protocolArea → standard library: The `Equatable` protocolHashableArea → standard library: The `Hashable` protocolArea → standard library: The `Hashable` protocolbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.documentationstandard libraryArea: Standard library umbrellaArea: Standard library umbrella