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

Can't access constants of subclass when use autoload #2054

Closed
yuutetu opened this issue Oct 17, 2014 · 1 comment
Closed

Can't access constants of subclass when use autoload #2054

yuutetu opened this issue Oct 17, 2014 · 1 comment

Comments

@yuutetu
Copy link

yuutetu commented Oct 17, 2014

# test.rb
class A
  class B
  end
end
# irb
> class A
> end
=> nil
> class X < A
>   autoload :B, "test"
> end
=> nil
> X::B
NameError: uninitialized constant X::B
    from org/jruby/RubyModule.java:2723:in `const_missing'
    from (irb):7:in `evaluate'
    from org/jruby/RubyKernel.java:1101:in `eval'
    from org/jruby/RubyKernel.java:1501:in `loop'
    from org/jruby/RubyKernel.java:1264:in `catch'
    from org/jruby/RubyKernel.java:1264:in `catch'
    from /Users/yuutetu/.rbenv/versions/jruby-1.7.16/bin/irb:13:in `(root)'
> X.const_get :B
=> A::B
@kares
Copy link
Member

kares commented Feb 18, 2016

working fine under latest 1.7.x

@kares kares closed this as completed Feb 18, 2016
@kares kares added this to the Invalid or Duplicate milestone Feb 18, 2016
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