Project

General

Profile

Actions

Bug #21318

open

Namespaces leak with Module.nesting

Added by fxn (Xavier Noria) 1 day ago. Updated about 12 hours ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:121952]

Description

Namespaces are not transparent for this program:

Module.nesting

The nesting is empty or not depending on whether it is being executed under a namespace.

Updated by fxn (Xavier Noria) 1 day ago ยท Edited

  • Subject changed from Namespaces leak with permanent names to Namespaces leak with Module.nesting

Updated by Eregon (Benoit Daloze) about 12 hours ago

Complete reproducer:

$ RUBY_NAMESPACE=1 ruby -ve 'p Module.nesting; ns = Namespace.new; File.write "ns.rb", "p Module.nesting"; ns.require "./ns"'
ruby 3.5.0dev (2025-05-10T07:50:29Z namespace-on-read-.. bd4f57f96b) +PRISM [x86_64-linux]
ruby: warning: Namespace is experimental, and the behavior may change in the future!
See doc/namespace.md for know issues, etc.
[]
[#<Namespace:24,user,optional>]
Actions

Also available in: Atom PDF

Like0
Like0Like0