JRuby

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

Hide
Charles Oliver Nutter added a comment -

Resolved in r8520.

Show
Charles Oliver Nutter added a comment - Resolved in r8520.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: