Make definition nesting usable for constant resolution - #877
Draft
soutaro wants to merge 4 commits into
Draft
Conversation
soutaro
force-pushed
the
codex/rubydex-resolve-constant
branch
from
June 29, 2026 08:44
3e92550 to
305e3f1
Compare
soutaro
force-pushed
the
codex/rubydex-resolve-constant
branch
from
July 14, 2026 03:59
305e3f1 to
adc7d6a
Compare
Assisted-By: devx/7c3d70e1-327c-4158-8ab5-ffccba197089
Assisted-By: devx/7c3d70e1-327c-4158-8ab5-ffccba197089
Assisted-By: devx/7c3d70e1-327c-4158-8ab5-ffccba197089
Assisted-By: devx/7c3d70e1-327c-4158-8ab5-ffccba197089
soutaro
force-pushed
the
codex/rubydex-resolve-constant
branch
from
August 10, 2026 06:18
adc7d6a to
0bc9457
Compare
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
Fix
Graph#resolve_constantfor lexical nesting stacks containing rooted or fully qualified namespace names.Background
When callers construct a nesting stack from
Definition#lexical_nesting, explicit qualification affects constant lookup. For example:The inner frame must remain
::Bar; treating it asBarwould incorrectly resolve it relative toFoo.Graph#resolve_constantcreates a temporaryNamechain from the supplied strings. Rooted and fully qualified frames can introduce parent-scope and lexical-nesting dependencies that have not yet been resolved. Previously, only the final name was resolved, so lookup could fail even when the corresponding declarations existed in the graph.Changes
Graph#resolve_constantAPI.source_nameto class, module, constant, and constant-alias definitions. Unlikename, it preserves explicit source-level qualification such asBar,Foo::Bar, or::Bar, allowing callers to construct constant-resolution nesting stacks without inferring qualification from resolved declarations.