From: "nahi (Hiroshi Nakamura)" Date: 2012-07-14T16:16:16+09:00 Subject: [ruby-core:46430] [ruby-trunk - Bug #6067][Closed] Conditional assignment of a nested constant raises a SyntaxError Issue #6067 has been updated by nahi (Hiroshi Nakamura). Status changed from Assigned to Closed ---------------------------------------- Bug #6067: Conditional assignment of a nested constant raises a SyntaxError https://bugs.ruby-lang.org/issues/6067#change-28050 Author: brixen (Brian Ford) Status: Closed Priority: Normal Assignee: matz (Yukihiro Matsumoto) Category: Target version: ruby -v: ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-darwin10.8.0] I can conditionally assign a simple constant: $ ruby -v -e 'p X ||= 1' ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-darwin10.8.0] 1 However, conditional assignment of a nested constant raises a SyntaxError: $ ruby -v -e 'module A; end; p A::X ||= 1' ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-darwin10.8.0] -e:1: constant re-assignment But I can assign the constant unconditionally, of course: $ ruby -v -e 'module A; end; p A::X = 1' ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-darwin10.8.0] 1 Is this a bug? Thanks, Brian -- http://bugs.ruby-lang.org/