History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: JRUBY-2349
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Marcin Mielzynski
Reporter: Vladimir Sizikov
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
JRuby

Bug in constant lookup on non Module or Class

Created: 01/Apr/08 03:34 AM   Updated: 15/Apr/08 03:44 AM
Component/s: Compiler
Affects Version/s: JRuby 1.1
Fix Version/s: None

Time Tracking:
Not Specified

Environment: Latest JRuby 1.1

Testcase included: yes


 Description  « Hide
ruby -e ':File::TEST' ---> e:1: File is not a class/module (TypeError)

jruby -e ':File::TEST' ---> undefined method `TEST' for :File:Symbol (NoMethodError)

Basically, JRuby raises different exception.

This bug is inspired by: http://rubinius.lighthouseapp.com/projects/5089/tickets/457

Also, since the new spec added, Jruby fails it now:

>bin/mspec ci -t j -X /opt/work/jruby.git/test/spec_excludes spec/ruby/1.8/language/constants_spec.rb
..........F....

1)
Constant lookup rule only searches a Module or Class FAILED
Expected TypeError
but got NoMethodError (undefined method `TEST' for :File:Symbol)
/opt/work/rbx.git/./mspec/expectations.rb:10:in `fail_with'
/opt/work/rbx.git/./mspec/expectations/should.rb:6:in `should'
/opt/work/rbx.git/./spec/ruby/1.8/language/constants_spec.rb:73:in `/opt/work/rbx.git/./spec/ruby/1.8/language/constants_spec.rb'
/opt/work/rbx.git/./mspec/runner/mspec.rb:112:in `call'
/opt/work/rbx.git/./mspec/runner/mspec.rb:112:in `protect'
/opt/work/rbx.git/./mspec/runner/state.rb:46:in `each'
/opt/work/rbx.git/./mspec/runner/state.rb:46:in `protect'
/opt/work/rbx.git/./mspec/runner/state.rb:60:in `process'
/opt/work/rbx.git/./mspec/runner/state.rb:56:in `each'
/opt/work/rbx.git/./mspec/runner/state.rb:56:in `process'
/opt/work/rbx.git/./mspec/runner/mspec.rb:19:in `describe'
/opt/work/rbx.git/./mspec/runner/object.rb:11:in `describe'
/opt/work/rbx.git/./spec/ruby/1.8/language/constants_spec.rb:17:in `/opt/work/rbx.git/./spec/ruby/1.8/language/constants_spec.rb'
/opt/work/rbx.git/./spec/ruby/1.8/language/constants_spec.rb:37:in `load'
/opt/work/rbx.git/./mspec/runner/mspec.rb:37:in `files'
/opt/work/rbx.git/./mspec/runner/mspec.rb:112:in `call'
/opt/work/rbx.git/./mspec/runner/mspec.rb:112:in `protect'
/opt/work/rbx.git/./mspec/runner/mspec.rb:37:in `files'
/opt/work/rbx.git/./mspec/runner/mspec.rb:34:in `each'
/opt/work/rbx.git/./mspec/runner/mspec.rb:34:in `files'
/opt/work/rbx.git/./mspec/runner/mspec.rb:26:in `process'
mspec/bin/mspec-ci:59


 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Marcin Mielzynski - 06/Apr/08 01:13 PM
Interpreter logic fixed in r6419. The compiler will require more tweakage since the logic is parcelled (would require two runtime helpers to extract) or more complex branching in ASTCompler.compileColon2.

Vladimir Sizikov - 15/Apr/08 03:44 AM
Another rubyspec now fails due to this too:
spec/ruby/1.8/language/class_spec.rb
...F..................

1)
A class definition raises TypeError if the constant qualifying the class is nil FAILED
Expected TypeError but no exception was raised
/opt/work/rbx.git/./mspec/expectations.rb:10:in `fail_with'
/opt/work/rbx.git/./mspec/expectations/should.rb:6:in `should'
/opt/work/rbx.git/./spec/ruby/1.8/language/class_spec.rb:29:in `/opt/work/rbx.git/./spec/ruby/1.8/language/class_spec.rb'
/opt/work/rbx.git/./mspec/runner/mspec.rb:119:in `call'
/opt/work/rbx.git/./mspec/runner/mspec.rb:119:in `protect'
/opt/work/rbx.git/./mspec/runner/state.rb:46:in `each'
/opt/work/rbx.git/./mspec/runner/state.rb:46:in `protect'
/opt/work/rbx.git/./mspec/runner/state.rb:60:in `process'
/opt/work/rbx.git/./mspec/runner/state.rb:56:in `each'
/opt/work/rbx.git/./mspec/runner/state.rb:56:in `process'
/opt/work/rbx.git/./mspec/runner/mspec.rb:26:in `describe'
/opt/work/rbx.git/./mspec/runner/object.rb:11:in `describe'
/opt/work/rbx.git/./spec/ruby/1.8/language/class_spec.rb:10:in `/opt/work/rbx.git/./spec/ruby/1.8/language/class_spec.rb'
/opt/work/rbx.git/./spec/ruby/1.8/language/class_spec.rb:44:in `load'
/opt/work/rbx.git/./mspec/runner/mspec.rb:44:in `files'
/opt/work/rbx.git/./mspec/runner/mspec.rb:119:in `call'
/opt/work/rbx.git/./mspec/runner/mspec.rb:119:in `protect'
/opt/work/rbx.git/./mspec/runner/mspec.rb:44:in `files'
/opt/work/rbx.git/./mspec/runner/mspec.rb:41:in `each'
/opt/work/rbx.git/./mspec/runner/mspec.rb:41:in `files'
/opt/work/rbx.git/./mspec/runner/mspec.rb:33:in `process'
mspec/bin/mspec-tag:83:in `run'
/opt/work/rbx.git/./mspec/bin/script.rb:77:in `main'
mspec/bin/mspec-tag:90

Finished in 0.371000 seconds

1 file, 22 examples, 35 expectations, 1 failure, 0 errors