xref: /llvm-project/clang-tools-extra/docs/clang-tidy/checks/objc/missing-hash.rst (revision 6e566bc5523f743bc34a7e26f050f1f2b4d699a8)
1.. title:: clang-tidy - objc-missing-hash
2
3objc-missing-hash
4=================
5
6Finds Objective-C implementations that implement ``-isEqual:`` without also
7appropriately implementing ``-hash``.
8
9Apple documentation highlights that objects that are equal must have the same
10hash value:
11https://developer.apple.com/documentation/objectivec/1418956-nsobject/1418795-isequal?language=objc
12
13Note that the check only verifies the presence of ``-hash`` in scenarios where
14its omission could result in unexpected behavior. The verification of the
15implementation of ``-hash`` is the responsibility of the developer, e.g.,
16through the addition of unit tests to verify the implementation.
17