Skip to content

Linearize ancestors for implicitly created namespaces - #1005

Open
HoneyryderChuck wants to merge 1 commit into
Shopify:mainfrom
HoneyryderChuck:fix-implicit-namespace-member-lookup
Open

Linearize ancestors for implicitly created namespaces#1005
HoneyryderChuck wants to merge 1 commit into
Shopify:mainfrom
HoneyryderChuck:fix-implicit-namespace-member-lookup

Conversation

@HoneyryderChuck

Copy link
Copy Markdown

A namespace implied only by compact definitions (class A::B::C, with no module A::B anywhere) gets a TodoDeclaration from create_todo_for_parent, which was the one namespace-creating path that never enqueued a Unit::Ancestors for it. Its chain stayed at the Ancestors::Partial([]) default, and since a namespace's own id is pushed onto that chain by linearize_ancestors, find_member_in_ancestors had nothing to walk: every member lookup returned MemberNotFound even though the member table was fully populated.

A namespace implied only by compact definitions (`class A::B::C`, with no
`module A::B` anywhere) gets a `TodoDeclaration` from
`create_todo_for_parent`, which was the one namespace-creating path that
never enqueued a `Unit::Ancestors` for it. Its chain stayed at the
`Ancestors::Partial([])` default, and since a namespace's own id is pushed
onto that chain by `linearize_ancestors`, `find_member_in_ancestors` had
nothing to walk: every member lookup returned `MemberNotFound` even though
the member table was fully populated.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@HoneyryderChuck
HoneyryderChuck requested a review from a team as a code owner August 14, 2026 14:31
@HoneyryderChuck

Copy link
Copy Markdown
Author

CLA signed, but can't rerun it.

Comment thread rust/rubydex/src/query.rs
}

#[test]
fn find_member_in_ancestors_returns_member_of_implicit_namespace() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think this test is needed. It's basically testing resolution behaviour in query tests.

Comment thread test/declaration_test.rb
end
end

def test_find_member_returns_members_of_implicit_namespaces

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should test this in the test in resolution_tests, and delete this one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants