Issue #9909 has been reported by First Last.

----------------------------------------
Feature #9909: why shouldn't constant lookup check the nesting of module's name
https://bugs.ruby-lang.org/issues/9909

* Author: First Last
* Status: Open
* Priority: Normal
* Assignee: 
* Category: 
* Target version: 
----------------------------------------
module A
  module B
  end
end

above, B will have access to A's constants
but below, it won't

module A::B
end

is there a reason why the nesting of the name should not be part of the constant resolution algorithm?

when adding or reopening (deeply) nested modules/classes the :: syntax would be preferable, but you lose constant resolution



-- 
https://bugs.ruby-lang.org/