Issue #6828 has been updated by trans (Thomas Sawyer).


It's not that. It's the constant lookup:

  module Foo
    X = 1
    module Bar
      p X  #=> 1
    end
  end

  module Foo::Bar
    p X  #=> NameError
  end

Personally I would prefer undefined namespaces be automatically instantiated as modules. If that was not the intent another error will pick it up quickly enough anyway. But that's not the main issue --the constant lookup is the important thing.


----------------------------------------
Feature #6828: Constancy of Constants
https://bugs.ruby-lang.org/issues/6828#change-28895

Author: trans (Thomas Sawyer)
Status: Open
Priority: Normal
Assignee: 
Category: core
Target version: 2.0.0


=begin
Could have swore there was a recent issue addressing this, but couldn't find it, so...

I hope by Ruby 2.0

  module Foo::Bar::Baz

will be equivalent to

  module Foo; module Bar; module Baz

That constant lookup doesn't work the same for both is really really really annoying.
=end



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