Skip to content

Include Hash::_Key interface in Object for correct key? typecheck#426

Merged
mame merged 1 commit intomasterfrom
hash-key-interface
Apr 7, 2026
Merged

Include Hash::_Key interface in Object for correct key? typecheck#426
mame merged 1 commit intomasterfrom
hash-key-interface

Conversation

@mame
Copy link
Copy Markdown
Member

@mame mame commented Apr 7, 2026

Hash#has_key? accepts _Key interface (hash + eql?) rather than the hash's key type parameter. Adding Object include _Key ensures that any object can be passed to key?/has_key?/include?/member? without type errors.

Hash#has_key? accepts _Key interface (hash + eql?) rather than the
hash's key type parameter. Adding Object include _Key ensures that
any object can be passed to key?/has_key?/include?/member? without
type errors.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mame mame merged commit 84cd000 into master Apr 7, 2026
12 checks passed
@mame mame deleted the hash-key-interface branch April 7, 2026 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant