Skip to content

Format constant declarations relative to their enclosing scope#371

Merged
mame merged 1 commit intoruby:masterfrom
pvcresin:fix/const-scope-scenario
Feb 18, 2026
Merged

Format constant declarations relative to their enclosing scope#371
mame merged 1 commit intoruby:masterfrom
pvcresin:fix/const-scope-scenario

Conversation

@pvcresin
Copy link
Contributor

@pvcresin pvcresin commented Feb 17, 2026

This PR fixes scenario/known-issues/const-scope.rb‎.

# before
class C
  C::D: Integer
end

# after
class C
  D: Integer
end

Details

  • dump_declarations now prints class/module-local constants as relative names
    (e.g. D: Integer instead of C::D: Integer inside class C).
  • Moved const-scope from scenario/known-issues to scenario/const since it now passes.
  • Updated affected scenario expectations to match the new output format.

This change is about declaration rendering only; core type inference behavior is unchanged.

Co-authored-by: Cursor <cursoragent@cursor.com>
@pvcresin pvcresin force-pushed the fix/const-scope-scenario branch from bb72bde to d78842f Compare February 17, 2026 14:17
Copy link
Member

@mame mame left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@mame mame merged commit 80a0f5f into ruby:master Feb 18, 2026
7 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

Comments