Skip to content

Fix module_function overlay semantics for Prism-based mruby compiler - #20

Merged
Asmod4n merged 1 commit into
mainfrom
claude/mruby-lsp-ci-failure-bvfqdb
Jul 29, 2026
Merged

Fix module_function overlay semantics for Prism-based mruby compiler#20
Asmod4n merged 1 commit into
mainfrom
claude/mruby-lsp-ci-failure-bvfqdb

Conversation

@Asmod4n

@Asmod4n Asmod4n commented Jul 29, 2026

Copy link
Copy Markdown
Owner

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/90637642083

mruby'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_function form (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-arg module_function :name now retroactively marks the instance copy private (via the existing retro_visibility helper) in addition to emitting the public singleton copy.
  • test/overlay/mruby_semantics_test.rb: updated the VM-pinning assertion (module_function_instance_stays_publicmodule_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 cases
  • Full test/overlay/*.rb suite run locally — all green (except mruby_semantics_test.rb, which requires a local mruby build not available in this sandbox)
  • CI (mruby_semantics_test.rb against the real Prism-based mruby build)

…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.
@Asmod4n
Asmod4n merged commit 053b486 into main Jul 29, 2026
2 checks passed
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.

2 participants