Fix module_function overlay semantics for Prism-based mruby compiler - #20
Merged
Conversation
…nce method CI caught mruby HEAD converging further toward CRuby: module_function :name no longer leaves the instance copy public (mirrors the bare-form change already pinned from 2026-07). Update buffer_harvester to retro-privatize the instance method alongside the public singleton copy, and update the pinning test, overlay coverage, and docs to match.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CI failed on
mruby_semantics_test.rb(module_function_instance_stays_public, got "no" want "yes"): https://github.com/Asmod4n/mruby-lsp/actions/runs/30470056050/job/90637642083mruby's compiler switched to Prism, which brings mruby's runtime semantics closer to CRuby by default. This is the same convergence already pinned for the bare
module_functionform (2026-07); this run shows the explicit-arg form (module_function :name) converged too — the instance copy is no longer left public, it becomes private, matching CRuby.lib/mruby_lsp/buffer_harvester.rb: explicit-argmodule_function :namenow retroactively marks the instance copyprivate(via the existingretro_visibilityhelper) in addition to emitting the public singleton copy.test/overlay/mruby_semantics_test.rb: updated the VM-pinning assertion (module_function_instance_stays_public→module_function_instance_becomes_private) to match the new observed mruby behavior.test/overlay/buffer_overlay_test.rb: added coverage for the explicit-arg form (singleton copy added, instance copy becomes private, shows up in the private methods table).docs/GOTCHAS.md: updated the module_function semantics summary, which was stale even before this fix (didn't reflect the already-pinned bare-form convergence).Test plan
ruby test/overlay/buffer_overlay_test.rb— all pass, including new explicit-arg module_function casestest/overlay/*.rbsuite run locally — all green (exceptmruby_semantics_test.rb, which requires a local mruby build not available in this sandbox)mruby_semantics_test.rbagainst the real Prism-based mruby build)