Skip to content

Implement the TOPLEVEL_BINDING constant - #429

Merged
tannevaled merged 1 commit into
mainfrom
feat/cluster7
Aug 22, 2026
Merged

tannevaled merged 1 commit into
mainfrom
feat/cluster7

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

TOPLEVEL_BINDING was undefined, so any code referencing it raised
uninitialized constant TOPLEVEL_BINDING — the bulk of the remaining
errors in the core/main specs, which use TOPLEVEL_BINDING.eval(...)
to exercise top-level behaviour.

It is now defined as a Binding whose receiver is main and whose
definee is Object, starting with no locals of its own — so
TOPLEVEL_BINDING.eval("def m; end" / "K = 1" / "self") defines
methods, assigns constants and reports self exactly as top-level code
does.

Verified against ruby 4.0.6; a full language+core sweep shows +8 with no
regressions (core/main/public now 5/5, private/using/to_s
improved as their constant-missing errors become runnable examples), and
the whole-suite coverage gate stays at 100.0%.

🤖 Generated with Claude Code

TOPLEVEL_BINDING was undefined, so any code referencing it raised
"uninitialized constant TOPLEVEL_BINDING" — this was the bulk of the
remaining errors in the core/main specs, which use
TOPLEVEL_BINDING.eval(...) to exercise top-level behaviour.

It is now defined as a Binding whose receiver is main and whose definee
is Object, starting with no locals of its own — so
TOPLEVEL_BINDING.eval("def m; end" / "K = 1" / "self") defines methods,
assigns constants and reports self exactly as top-level code does.

Verified against ruby 4.0.6; this lifts the core/main specs (public now
5/5, private/using improved) by turning the constant-missing errors into
runnable examples.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit 377bef5 into main Aug 22, 2026
7 checks passed
@tannevaled
tannevaled deleted the feat/cluster7 branch August 22, 2026 08:53
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