Skip to content

Handle Data members that override __send__ - #97

Open
OskarEichler wants to merge 1 commit into
ruby:masterfrom
OskarEichler:codex/data-send-member
Open

Handle Data members that override __send__#97
OskarEichler wants to merge 1 commit into
ruby:masterfrom
OskarEichler:codex/data-send-member

Conversation

@OskarEichler

Copy link
Copy Markdown

Summary

Dispatch Data member reads through the core send, preventing a member named send from shadowing the dispatcher.

Reproduction and verification

PP.singleline_pp(Data.define(:send, :other).new(1, 2), String.new) raises ArgumentError before this patch. The corpus also covers [], class, members, size and to_a. Existing private/removed-member cases remain green.

  • Isolated branch: 6 focused checks pass under rbenv Ruby 4.0.6.
  • Existing upstream RBENV_VERSION=4.0.6 rbenv exec rake test: 36 tests / 56 assertions, zero failures before and after.
  • 2,000 ordinary single-/multi-line outputs remain byte-identical.
  • Source-only change; no test files added or modified under the contributor's task constraint. Focused scripts are outside the repository. Other Ruby engines/versions and native Windows were not executed.

Breaking-change notes

No API removal. Data members named send now print successfully. Actual member accessors, including private ones, are still dispatched normally; existing handling of removed members is unchanged.

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