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

cannot see a constant defined in the grandparent module from doubly-nested singleton class #3598

Closed
tsahara opened this issue Apr 10, 2017 · 1 comment

Comments

@tsahara
Copy link
Member

tsahara commented Apr 10, 2017

module A
  CONST = 123
  class << self
    p 1, CONST
    class << self
      p 2, CONST
    end
  end
end
% ruby -v a.rb
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin16]
1
123
2
123

% bin/mruby a.rb
1
123
trace:
	[0] a.rb:6
	[1] a.rb:5
	[2] a.rb:3
	[3] a.rb:1
a.rb:6: uninitialized constant #<Class:#<Class:A>>::CONST (NameError)
@keizo042
Copy link
Contributor

I send PR that I fix the issue. plz check there are something wrong any more.

@matz matz closed this as completed in 4fca570 Apr 12, 2017
matz added a commit that referenced this issue Apr 12, 2017
Find Class/Module in nested singleton class; fix #3598
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

No branches or pull requests

2 participants