ruby
ruby copied to clipboard
Update child module name when parent gets a temp name set
When calling set_temporary_name on a parent module the child modules should get their name updated too.
Before:
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"
After:
m = Module.new
m::N = Module.new
p m::N.name # => "#<Module:0x000000010d0a00b0>::N"
m.set_temporary_name("foo")
p m::N.name # => "foo::N"
Shouldn’t this change too?
m = Module.new
m::N = Module.new
m::N::O = Module.new
m.set_temporary_name("foo")
p m::N::O
Ah yea that should work too. I'll fix it tomorrow morning.