Issue #5449 has been updated by Yasushi ANDO.
File parse.y.patch added
I checked this just for my curiosity.
Foo ||= 42
does not work on ruby1.8,
::Foo = 42 # constant re-assignment
Foo = Foo || 42 # uninitialized constant
and these two statements raise exceptions on ruby1.9. IMHO, "Foo ||= 42" should raise an error on 1.9. I attached my poor patch for the purpose of reference.
----------------------------------------
Bug #5449: nested constant opasign not working
http://redmine.ruby-lang.org/issues/5449
Author: Konstantin Haase
Status: Open
Priority: Normal
Assignee:
Category: core
Target version:
ruby -v: 1.9.2-p290
=begin
This code works on 1.9:
Foo ||= 42
However, (({ ::Foo ||= 42 })) and
Foo ||= Module.new
Foo::Bar ||= 42
both raise a SyntaxError: constant re-assignment.
(Note: I had to use the (({...})) syntax so Redmine wouldn't turn ::Foo into a link)
=end
--
http://redmine.ruby-lang.org