Skip to content

Fix recursive superclass check in singleton_ancestors - #3257

Open
dak2 wants to merge 1 commit into
ruby:masterfrom
dak2:fix-singleton-ancestors-recursion
Open

dak2 wants to merge 1 commit into
ruby:masterfrom
dak2:fix-singleton-ancestors-recursion

Conversation

@dak2

@dak2 dak2 commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

The superclass recursion reset building_ancestors, so a cycle raised SystemStackError instead of RecursiveAncestorError in singleton_ancestors.

instance_ancestors and interface_ancestors already pass building_ancestors through and raise RecursiveAncestorError for cycles. This PR does the same in singleton_ancestors.

I found this while reading the RBS core, because I'm porting definition building to the ruby-rbs crate.

The superclass recursion reset building_ancestors, so a cycle raised
SystemStackError instead of RecursiveAncestorError.
@dak2
dak2 marked this pull request as ready for review October 25, 2026 10:07
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.

1 participant