From: Thomas Enebo Date: 2007-05-07T08:33:57+09:00 Subject: overriding autoloads with classes and modules Works (arbitrary constant assignment overrides autoload): --- autoloaded.rb --- Foo = 1 --- autoloaded.rb --- --- main.rb --- autoload "Foo", "autoloaded.rb" Foo = 2 assert_equal(2, Foo) --- main.rb --- Does not work (override with class OR module definition): --- main2.rb --- autoload "Foo", "autoloaded.rb" class Foo; end --- main2.rb --- I had patched JRuby to allow this second case for both modules and classes, but then noticed that Ruby 1.8.5 (I did not check 1.9) doesn't work (Foo is not a class). I have undid these changes in JRuby to make sure we match MRI behavior. Is this a bug? From my perspective I think if you allow object assignment to work to override autoloads you should also allow class or module definition to do it as well. -Tom -- Thomas E Enebo JRuby Core Developer, http://www.bloglines.com/blog/ThomasEEnebo