Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
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 :
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'