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

Including modules creates an infinite loop between methods #1088

Open
rmosolgo opened this issue Jan 31, 2024 · 0 comments
Open

Including modules creates an infinite loop between methods #1088

rmosolgo opened this issue Jan 31, 2024 · 0 comments

Comments

@rmosolgo
Copy link

Hi! I think RDoc sometimes wrongly infers module ancestry and then methods can have cyclical see references.

I encountered this error in the docs for GrpahQL-Ruby (fix: rmosolgo/graphql-ruby#4819) and I created this script to replicate it:

# rdoc_bug.rb
module DoSomething
  def self.generate_module
    Module.new do
      include DoSomethingExtra
    end
  end

  def do_something
    1 + 1
  end

  module DoSomethingExtra
    include DoSomething

    def do_something
      super + 1
    end
  end
end

For me, that script ends in "stack level too deep":

$ rdoc rdoc_bug.rb
Parsing sources...
100% [ 1/ 1]  rdoc_bug.rb

Generating Darkfish format into /Users/rmosolgo/code/graphql-ruby/doc...
uh-oh! RDoc had a problem:
stack level too deep

run with --debug for full backtrace

I was able to work around it, so this bug is not blocking me, but I thought I'd open it here in case its helpful to anyone else.

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

No branches or pull requests

1 participant