Attempt to use receiver as parent class when it's a call node#651
Merged
Attempt to use receiver as parent class when it's a call node#651
Conversation
7a593bf to
8f0b663
Compare
vinistock
reviewed
Mar 27, 2026
Member
vinistock
left a comment
There was a problem hiding this comment.
I think the resolution changes can be shipped, but I do think the superclass API will be nicer returning constant reference objects
8f0b663 to
6d63202
Compare
vinistock
approved these changes
Apr 13, 2026
Co-authored-by: Alexandre Terrasa <Morriar@users.noreply.github.com>
6d63202 to
1d2e0e7
Compare
vinistock
added a commit
that referenced
this pull request
Apr 15, 2026
Ensure that ancestors are marked as partial if the parent class reference is not resolved. Extracted from #651
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
class Foo < Baris indexed andBaris never defined,Foo's ancestor chain was silently falling back to[Foo, Object, BasicObject](partial) —Barwas completely absent. This is inconsistent with how unresolved mixins are handled, which pushAncestor::Partial(name_id)as a placeholder.linearize_parent_classnow returnsAncestors::Partial([Ancestor::Partial(name_id)])instead of falling back to Object's chain.assert_ancestors_eqto compare by name string, so it works uniformly for bothCompleteandPartialancestor entries (previously panicked onAncestors::Partial).Class#superclass_nameRuby API that returns the unresolved superclass name as written in source, ornilwhen resolved or absent.Test plan
unresolved_superclass_is_represented_as_partial_ancestorverifiesclass Foo < Baryields["Foo", "Bar"]test_superclass_name_returns_nil_when_superclass_is_resolvedandtest_superclass_name_returns_name_when_superclass_is_unresolvedcargo test— all 380 tests passbundle exec ruby -Itest test/declaration_test.rb— all 23 tests passcargo clippy --all-targets -- -D warnings— clean