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