Actions
Bug #21094
openModule#set_temporary_name does not affect a name of a nested module
Description
Wondering whether it's intentional and correct behaviour:
m = Module.new
m::N = Module.new
p m::N.name # => "#<Module:0x000000010d0a00b0>::N"
m.set_temporary_name("foo")
p m::N.name # => "#<Module:0x000000010d0a00b0>::N"
I would expect that setting foo
as a temporary name changes m::N.name
to foo::N
.
Updated by eileencodes (Eileen Uchitelle) 2 days ago
This seems like a bug to me because if you set the temp name before creating N
it works as you expected. Opened a PR https://github.com/ruby/ruby/pull/12658
Actions
Like0
Like1