Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove non-existing algorithm path for constant resolution #2158

Merged
merged 1 commit into from
Jun 11, 2024

Conversation

vinistock
Copy link
Member

Motivation

In #2136, we actually made a mistake. Ruby does not treat qualified or unqualified constant references differently, that was a misunderstanding.

The algorithm is the same for both and will always favour enclosing lexical scopes above inheritance.

Implementation

Removed the entire path algorithm path for qualified references and kept only the one implementation, which handles all cases.

Automated Tests

Added a test that catches the mistake in the implementation.

@vinistock vinistock added bugfix This PR will fix an existing bug server This pull request should be included in the server gem's release notes labels Jun 11, 2024
@vinistock vinistock self-assigned this Jun 11, 2024
@vinistock vinistock requested a review from a team as a code owner June 11, 2024 16:41
@vinistock vinistock requested review from andyw8 and st0012 June 11, 2024 16:41
@vinistock vinistock merged commit a18084c into main Jun 11, 2024
36 checks passed
@vinistock vinistock deleted the vs/fix_constant_resolution branch June 11, 2024 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This PR will fix an existing bug server This pull request should be included in the server gem's release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants