On Sun, Mar 7, 2010 at 11:34 AM, Xavier Noria <fxn / hashref.com> wrote: >> So we *should* find it in Object and MRI is incorrect to return nil. > > Or else the spec needs rewording. > > Looking for Object for non-scoped constants in modules seems like a > lexical rule to me, akin to searching Module.nesting. > > In a scoped constant reference I wouldn't expect lexical-like steps to > be followed, so it might be the case that M::XYZ does not have to look > in Object, while C::XYZ needs to because of the ancestors rule. That > would a posteriori explain MRI's behavior. > > We need an authoritative answer, I saw the question was posted to > ruby-core, let's see. Just a followup, the spec has been indeed revised, M::X does not look in Object.