Project

General

Profile

Actions

Feature #12319

open

`Module#const_get` does not accept symbol with nested name

Added by sawa (Tsuyoshi Sawada) over 8 years ago. Updated almost 5 years ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:75184]

Description

Module#const_get accepts non-nested string, nested string, and non-nested symbol:

class A; class B; class C end end end

A.const_get("B")    # => A::B
A.const_get("B::C") # => A::B::C
A.const_get(:B)     # => A::B

but does not accept nested symbol:

A.const_get(:"B::C") # => NameError: wrong constant name B::C

I would like this to be made possible.


Related issues 1 (0 open1 closed)

Related to Ruby master - Feature #5690: Module#qualified_const_getClosedtenderlovemaking (Aaron Patterson)Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0