Skip to content

Implement retroactive module_function singleton copies#800

Open
slbug wants to merge 2 commits into
Shopify:mainfrom
slbug:retroactive_module_function
Open

Implement retroactive module_function singleton copies#800
slbug wants to merge 2 commits into
Shopify:mainfrom
slbug:retroactive_module_function

Conversation

@slbug
Copy link
Copy Markdown

@slbug slbug commented May 10, 2026

Handles cursed module_function :foo runtime behavior.

Ruby doesn’t just mark foo private — it snapshots the current method entry, installs a private instance copy, and exposes a public singleton copy. Also works when foo comes from an included module, because of course it does.

This wires that up in resolution, tracks the generated copies so incremental reindexing can tear them down/rebuild them when the source method, visibility call, or ancestor chain changes, and covers the attr_* edge cases too.

@slbug slbug requested a review from a team as a code owner May 10, 2026 21:04
@slbug
Copy link
Copy Markdown
Author

slbug commented May 10, 2026

I have signed the CLA!

@slbug slbug force-pushed the retroactive_module_function branch 2 times, most recently from f53f0c3 to 7d1cff3 Compare May 11, 2026 22:14
@slbug slbug force-pushed the retroactive_module_function branch from 4077397 to d73e9db Compare May 14, 2026 05:27
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