From: sawadatsuyoshi@... Date: 2016-04-26T05:57:34+00:00 Subject: [ruby-core:75192] [Ruby trunk Bug#12319] `Module#const_get` does not accept symbol with nested name Issue #12319 has been updated by Tsuyoshi Sawada. Nobuyoshi Nakada wrote: > It's the intended behavior. > `Symbol` is a single name, not a class/module path. I don't see any mentioning to symbol in #5690. If this is intended, I would like to ask it as a feature request. It is confusing/surprising that something you can do with string can be done with symbol, but cannot be completely done. ---------------------------------------- Bug #12319: `Module#const_get` does not accept symbol with nested name https://bugs.ruby-lang.org/issues/12319#change-58326 * Author: Tsuyoshi Sawada * Status: Open * Priority: Normal * Assignee: * ruby -v: * Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN ---------------------------------------- `Module#const_get` accepts non-nested string, nested string, and non-nested symbol: ~~~ruby 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: ~~~ruby A.const_get(:"B::C") # => NameError: wrong constant name B::C ~~~ -- https://bugs.ruby-lang.org/ Unsubscribe: