This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse the repository at this point in the history
Consider an autoload resolved if #resolve didn't return nil in Autolo…
…ad#call This fixes cases of autoload "errors" mentioned by @robin850 in #2934 (comment) and https://gist.github.com/robin850/3eeaed2538f50a9887c2 This is an explanation of the issue: We already have A::B been autoloaded by the main thread. When c.rb (see any of the previous links) is being autoloaded in another thread, class A::B is being opened using Rubinius.open_class_under (through Rubinius.open_class). Since module A has an Autoload entry for B in its constant_table, open_class_under tries to call #call on this Autload object, which returns nil because #resolve returns false (CodeLoader.require returns false if a feature is already been loaded). With nil returned, open_class_under decided to create a new Class object for B, which means the autoload entry it already had for :C is lost, resulting in constant A::B::C not being found.
- Loading branch information
Showing 1 changed file with 1 addition and 1 deletion.