class RuboCop::Cop::Lint::HashCompareByIdentity
= :bar
hash = {}.compare_by_identity
# good<br><br>hash.key?(baz.object_id)<br>hash = :bar
hash = {}
# bad
@example
besides ‘object_id`s.
This cop is marked as unsafe as a hash possibly can contain other keys
Prefer using `Hash#compare_by_identity` than using `object_id` for hash keys.
def on_send(node)
def on_send(node) add_offense(node) if id_as_hash_key?(node) end