Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Compare property default instance locations by id
The keys used to collect property defaults are mutable hashes, which causes weird hash table problems when they're modified (`#hash` no longer matches even though they have the same `#object_id`). Explained here: https://docs.ruby-lang.org/en/3.3/Hash.html#class-Hash-label-Modifying+an+Active+Hash+Key I think this problem got covered up a bit because it requires more than 8 keys for values to be dropped. `compare_by_identity` fixes things by just using `#object_id` to compare hash keys. It stays consistent after the hash key is mutated. From the [docs][0]: > Note: this requirement does not apply if the Hash uses > `compare_by_identity` since comparison will then rely on the keys' > object id instead of `hash` and `eql?`. Fixes: #179 [0]: https://docs.ruby-lang.org/en/3.3/Hash.html#class-Hash-label-User-Defined+Hash+Keys
- Loading branch information