Skip to content

Complete Types::Block hash semantics - #3136

Open
OskarEichler wants to merge 1 commit into
ruby:masterfrom
OskarEichler:codex/block-hash-contract
Open

Complete Types::Block hash semantics#3136
OskarEichler wants to merge 1 commit into
ruby:masterfrom
OskarEichler:codex/block-hash-contract

Conversation

@OskarEichler

Copy link
Copy Markdown

Summary

RBS::Types::Block implements value equality with ==, but does not alias eql? or define a corresponding hash. Equal block types therefore behave as different Hash/Set keys, unlike the surrounding immutable type objects.

Add eql? and compute the hash from the same type, required flag, and self type used by equality.

Verification

  • baseline model reproduces the Hash-key miss; focused and cumulative candidates pass
  • type tests: 3 tests / 44 assertions
  • all 109 runtime files compile on Ruby 4.0.6
  • focused candidate syntax, RuboCop, and diff checks pass

Source-only change; no test file is included.

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