Project

General

Profile

Actions

Bug #21094

closed

Module#set_temporary_name does not affect a name of a nested module

Added by andrykonchin (Andrew Konchin) 2 months ago. Updated 2 days ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:120808]

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 months 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 #2

Updated by nobu (Nobuyoshi Nakada) 13 days ago

  • Backport changed from 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN to 3.1: DONTNEED, 3.2: DONTNEED, 3.3: REQUIRED, 3.4: REQUIRED
Actions #3

Updated by nobu (Nobuyoshi Nakada) 13 days ago

  • Status changed from Open to Closed

Applied in changeset git|f69ad0e810e1fdc18dc12f77bbecfa49999ef3bf.


[Bug #21094] Update nested module names when setting temporary name

Updated by alanwu (Alan Wu) 4 days ago

  • Backport changed from 3.1: DONTNEED, 3.2: DONTNEED, 3.3: REQUIRED, 3.4: REQUIRED to 3.1: DONTNEED, 3.2: DONTNEED, 3.3: REQUIRED, 3.4: DONE

Updated by nagachika (Tomoyuki Chikanaga) 2 days ago

  • Backport changed from 3.1: DONTNEED, 3.2: DONTNEED, 3.3: REQUIRED, 3.4: DONE to 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONE, 3.4: DONE
Actions

Also available in: Atom PDF

Like0
Like1Like0Like0Like0Like0