JRuby (please use github issues at http://bugs.jruby.org)
  1. JRuby (please use github issues at http://bugs.jruby.org)
  2. JRUBY-3277

Constant lookup should omit topmost lexical scope; not bail out on first Object-hosting lexical scope

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.1.6
    • Fix Version/s: JRuby 1.2
    • Component/s: Core Classes/Modules
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Two new RubySpec failures pointed at a behavioral flaw in our constant lookup. Specifically, we bailed out of lexical lookup at the first cref == Object. The correct behavior is to avoid searching the topmost lexical scope (toplevel) but to still search Object-based cref lexical scopes lower in the search. I have a fix prepared. Here is the two failures from the specs:

      1)
      Constant resolution within methods with statically assigned constants searches Object as a lexical scope only if Object is explicitly opened FAILED
      Expected :const20_2
       to equal :const20_1
      
      spec/ruby/language/constants_spec.rb:199
      spec/ruby/language/constants_spec.rb:149
      spec/ruby/language/constants_spec.rb:54:in `load'
      
      2)
      Constant resolution within methods with dynamically assigned constants searches Object as a lexical scope only if Object is explicitly opened FAILED
      Expected :const211_2
       to equal :const211_1
      
      spec/ruby/language/constants_spec.rb:294
      spec/ruby/language/constants_spec.rb:149
      spec/ruby/language/constants_spec.rb:54:in `load'
      

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Charles Oliver Nutter
            Reporter:
            Charles Oliver Nutter
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: