
Issue #21094 has been updated by eileencodes (Eileen Uchitelle). 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 ---------------------------------------- Bug #21094: Module#set_temporary_name does not affect a name of a nested module https://bugs.ruby-lang.org/issues/21094#change-111678 * Author: andrykonchin (Andrew Konchin) * Status: Open * ruby -v: 3.4.1 * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- Wondering whether it's intentional and correct behaviour: ```ruby 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`. -- https://bugs.ruby-lang.org/