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

Another constant lookup issue #2492

Open
seven1m opened this issue Jan 11, 2025 · 0 comments
Open

Another constant lookup issue #2492

seven1m opened this issue Jan 11, 2025 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@seven1m
Copy link
Member

seven1m commented Jan 11, 2025

class C
  module M
  end 

  class << self
    Mod = M # <=== NameError
  end
end

produces the following error:

# wat.rb:6:in 'const_missing': uninitialized constant #<Class:C>::M (NameError)

This was discovered in the Rake gem here.

I'm not sure how similar this is to #2269, but maybe there's some solution that solves both issues.

@seven1m seven1m added the bug Something isn't working label Jan 11, 2025
@seven1m seven1m changed the title Another constant scoping issue Another constant lookup issue Jan 11, 2025
@seven1m seven1m self-assigned this Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant