Project

General

Profile

Actions

Bug #5449

closed

nested constant opasign not working

Added by rkh (Konstantin Haase) about 13 years ago. Updated almost 12 years ago.

Status:
Closed
Target version:
ruby -v:
1.9.2-p290
Backport:
[ruby-core:40154]

Description

=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


Files

parse.y.patch (481 Bytes) parse.y.patch technohippy (Yasushi ANDO), 10/19/2011 11:44 AM

Related issues 1 (0 open1 closed)

Has duplicate Ruby master - Bug #6067: Conditional assignment of a nested constant raises a SyntaxErrorClosedmatz (Yukihiro Matsumoto)02/23/2012Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0