We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm not sure Ruby's scoping rule allows it but it is not compatible with CRuby.
module A CONST = 123 class << self p 1, CONST class B 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:0x7fd92a802ce0>::B::CONST (NameError)
The text was updated successfully, but these errors were encountered:
Right. I guess the main-ruby behaviour may be the correct one.
(Note that the code that you showed, does not output what you added lateron, e. g. there is no 1 and no 2 output on a single line.)
Sorry, something went wrong.
I updated the issue comment. Thank you.
Get constant of parent class even if child class is defined in signle…
fd0f79c
…ton class; fix mruby#3575
Successfully merging a pull request may close this issue.
I'm not sure Ruby's scoping rule allows it but it is not compatible with CRuby.
The text was updated successfully, but these errors were encountered: