-
-
Notifications
You must be signed in to change notification settings - Fork 942
Closed as duplicate of#8923
Milestone
Description
Marking an autoload constant as a private_constant makes them seem uninitialized. Test case:
test.rb:
class Foo
autoload :Bar, 'bar'
private_constant :Bar
def self.bar
Bar
end
end
p Foo.barbar.rb:
puts "loading bar"
Bar = "fubar"jruby -I. test.rb
NameError: uninitialized constant Foo::Bar
const_missing at org/jruby/RubyModule.java:4867
bar at const2.rb:8
<main> at const2.rb:12
If it runs it should show:
loading bar
"fubar"
What is interesting is there is no "loading bar" print so I will guess that marking Bar private is preventing the autoload from firing.
Note that this does not affect JRuby 9.4. Only 10.0.x
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels