From: "tagomoris (Satoshi Tagomori) via ruby-core" Date: 2025-12-09T12:52:32+00:00 Subject: [ruby-core:124098] [Ruby Bug#21316] Namespaces leak with permanent names Issue #21316 has been updated by tagomoris (Satoshi Tagomori). Now the name of classes defined in a box is just its name. ``` MBA:build s-tagomori$ RUBY_BOX=1 ./exe/ruby -e 'Ruby::Box.new.eval("class C; end; p(name: C.name, eq: C.name == \"C\")")' ./exe/ruby: warning: Ruby::Box is experimental, and the behavior may change in the future! See doc/language/box.md for known issues, etc. {name: "C", eq: true} MBA:build s-tagomori$ RUBY_BOX=1 ./exe/ruby -v ruby 4.0.0dev (2025-12-09T12:29:36Z box-news-documents.. c998717de8) +PRISM [arm64-darwin24] MBA:build s-tagomori$ ./exe/ruby: warning: Ruby::Box is experimental, and the behavior may change in the future! See doc/language/box.md for known issues, etc. {name: "C", eq: true} MBA:build s-tagomori$ RUBY_BOX=1 ./exe/ruby -v ruby 4.0.0dev (2025-12-09T12:29:36Z box-news-documents.. c998717de8) +PRISM [arm64-darwin24] ``` ---------------------------------------- Bug #21316: Namespaces leak with permanent names https://bugs.ruby-lang.org/issues/21316#change-115542 * Author: fxn (Xavier Noria) * Status: Closed * Assignee: tagomoris (Satoshi Tagomori) * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- Namespaces are not transparent for this program ```ruby C = Class.new C.name == 'C' ``` because under a non-main user namespace, the name of `C` has the namespace as a prefix. -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/