On Dec 17, 11:47 am, MonkeeSage [email protected] wrote:
Is the above still the case with 1.9?
Maybe it’s because (I assume) this is a paired-down example, but in
the example class Whee1 is in the scope of module Foo, and so is
module Bar, but module Bar isn’t in the scope of class Foo::Whee2, so
you have to include it as qualified Foo::Bar. It doesn’t look like
module Bar is lexically scoped to class Foo.
The actual situation was that I started writing code all nested as in
the first example. Everything was working, my unit tests were passing,
all was right with the world.
But I didn’t like the nesting. The extra level of folding was getting
in the way, and the non-explicit nesting made my function pop up not
the way I wanted.
So I changed the code in a way that I thought was purely formatting; I
pulled the classes (and modules) out to the top level with an explicit
Foo:: prefix for each. And I was surprised when my code stopped
It was simple enough to see the error, and not very painful to find
all the cases where I had included the module and also add the Foo::
prefix. But it surprised me. Despite likely reading about this issue
previously, I had thought constant resolution would not be affected by
that particular edit.