ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:121955] [Ruby Bug#21320] Namespaces leak with constant lookup
@ 2025-05-09 23:07 fxn (Xavier Noria) via ruby-core
  2025-05-10  8:36 ` [ruby-core:121969] " fxn (Xavier Noria) via ruby-core
  2025-05-10 12:17 ` [ruby-core:121984] " Eregon (Benoit Daloze) via ruby-core
  0 siblings, 2 replies; 3+ messages in thread
From: fxn (Xavier Noria) via ruby-core @ 2025-05-09 23:07 UTC (permalink / raw)
  To: ruby-core; +Cc: fxn (Xavier Noria)

Issue #21320 has been reported by fxn (Xavier Noria).

----------------------------------------
Bug #21320: Namespaces leak with constant lookup
https://bugs.ruby-lang.org/issues/21320

* Author: fxn (Xavier Noria)
* Status: Open
* Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN
----------------------------------------
The following program

```ruby
X = :top

class C
  X = :super
end

class D < C
  p X
end
```

prints `:super` normally, and `:top` if running under a namespace.



-- 
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/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ruby-core:121969] [Ruby Bug#21320] Namespaces leak with constant lookup
  2025-05-09 23:07 [ruby-core:121955] [Ruby Bug#21320] Namespaces leak with constant lookup fxn (Xavier Noria) via ruby-core
@ 2025-05-10  8:36 ` fxn (Xavier Noria) via ruby-core
  2025-05-10 12:17 ` [ruby-core:121984] " Eregon (Benoit Daloze) via ruby-core
  1 sibling, 0 replies; 3+ messages in thread
From: fxn (Xavier Noria) via ruby-core @ 2025-05-10  8:36 UTC (permalink / raw)
  To: ruby-core; +Cc: fxn (Xavier Noria)

Issue #21320 has been updated by fxn (Xavier Noria).


This is probably a consequence of https://bugs.ruby-lang.org/issues/21318.

----------------------------------------
Bug #21320: Namespaces leak with constant lookup
https://bugs.ruby-lang.org/issues/21320#change-113085

* Author: fxn (Xavier Noria)
* Status: Open
* Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN
----------------------------------------
The following program

```ruby
X = :top

class C
  X = :super
end

class D < C
  p X
end
```

prints `:super` normally, and `:top` if running under a namespace.



-- 
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/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ruby-core:121984] [Ruby Bug#21320] Namespaces leak with constant lookup
  2025-05-09 23:07 [ruby-core:121955] [Ruby Bug#21320] Namespaces leak with constant lookup fxn (Xavier Noria) via ruby-core
  2025-05-10  8:36 ` [ruby-core:121969] " fxn (Xavier Noria) via ruby-core
@ 2025-05-10 12:17 ` Eregon (Benoit Daloze) via ruby-core
  1 sibling, 0 replies; 3+ messages in thread
From: Eregon (Benoit Daloze) via ruby-core @ 2025-05-10 12:17 UTC (permalink / raw)
  To: ruby-core; +Cc: Eregon (Benoit Daloze)

Issue #21320 has been updated by Eregon (Benoit Daloze).


Full repro:
```
# Copy the description program to program.rb, e.g. $ xsel -b > program.rb
$ RUBY_NAMESPACE=1 ruby -ve 'puts "in main"; require "./program"; puts "in namespace"; Namespace.new.require "./program"' 
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.
in main
:super
in namespace
:top
```

----------------------------------------
Bug #21320: Namespaces leak with constant lookup
https://bugs.ruby-lang.org/issues/21320#change-113100

* Author: fxn (Xavier Noria)
* Status: Open
* Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN
----------------------------------------
The following program

```ruby
X = :top

class C
  X = :super
end

class D < C
  p X
end
```

prints `:super` normally, and `:top` if running under a namespace.



-- 
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/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-05-10 12:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-09 23:07 [ruby-core:121955] [Ruby Bug#21320] Namespaces leak with constant lookup fxn (Xavier Noria) via ruby-core
2025-05-10  8:36 ` [ruby-core:121969] " fxn (Xavier Noria) via ruby-core
2025-05-10 12:17 ` [ruby-core:121984] " Eregon (Benoit Daloze) via ruby-core

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).