does not parse defined?(self::FOO) correctly
Reported by cremes | June 17th, 2008 @ 04:58 PM | in 1.0 preview
This code fails in rubinius but works correctly in MRI and JRuby:
module A
self::FOO = 'x' unless defined? self::FOO
end
It throws a NameError exception and produces this backtrace:
NameError: wrong constant name self
from Module#normalize_const_name at kernel/core/module.rb:895
from Module#recursive_const_get at kernel/core/module.rb:854
from MethodContext#const_path_defined? at kernel/core/context.rb:238
from A.__module_init__ (A) at (irb):2
from Object#irb_binding {} at (irb):1
This was discovered while trying to load gem 'arrayfields' for testing. It uses the above construct to track the VERSION of the gem.
I would have attached a spec but I am not sure where it ought to go.
Comments and changes to this ticket
-

cremes June 18th, 2008 @ 07:37 PM
Fixed this bug. See commit 3bccd39ba2d09e0a1f5192f7b5f15849f38f4190
Now I'm attempting to get the rubyspec patch that exposes this problem committed. That is going less than smoothly right now...
Feel free to close this ticket.
-
Federico Builes June 19th, 2008 @ 03:51 PM
- → State changed from new to resolved
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
