CARVIEW |
Select Language
HTTP/2 200
cache-control: max-age=0, private, must-revalidate
content-type: text/html; charset=utf-8
etag: W/"4376d401ca4d6e4773a32d05cdd405c4"
nel: {"report_to":"heroku-nel","response_headers":["Via"],"max_age":3600,"success_fraction":0.01,"failure_fraction":0.1}
referrer-policy: strict-origin-when-cross-origin
report-to: {"group":"heroku-nel","endpoints":[{"url":"https://nel.heroku.com/reports?s=bzGBBHCdtNMou7sGwz9u0SZ%2FfshTANfS8fRMOv2CLlw%3D\u0026sid=e11707d5-02a7-43ef-b45e-2cf4d2036f7d\u0026ts=1753266110"}],"max_age":3600}
reporting-endpoints: heroku-nel="https://nel.heroku.com/reports?s=bzGBBHCdtNMou7sGwz9u0SZ%2FfshTANfS8fRMOv2CLlw%3D&sid=e11707d5-02a7-43ef-b45e-2cf4d2036f7d&ts=1753266110"
server: Heroku
set-cookie: _redmine_session=a1Q0NGorQXVzU2svdGs0K1ZiTUM1cEpDYkwySW8yTlg1SGRJeU53TDRIcGQvVFBkUmE0YU1IRGdwcmpxaWVFU0duQTRCSkpqTEJ4dnVvSCs4Y3dkU1pvNG1McXlJejd4ejd5NURUSC9rL1IyN3FxN0UzcWNZemFESWo3Yll5UzBvOEprZUFmTndORG9KanBJTDJhQ1BDRE9EYWg5S0F6S3lBNXZ2aVNYQlBZTGozSEtqWmlFNExFM1JudS9HL2QvLS0zTmpieUZzZTJ2b2svUWZ2YSsyYW1nPT0%3D--c5288c18fc8fb142cc5cb68c4a29b262a3c67e00; path=/; secure; httponly; samesite=lax
strict-transport-security: max-age=63072000; includeSubDomains
vary: Accept
via: 2.0 heroku-router
x-content-type-options: nosniff
x-download-options: noopen
x-frame-options: SAMEORIGIN
x-permitted-cross-domain-policies: none
x-request-id: ebfe5b8f-2073-85b3-aff9-060afe64c638
x-runtime: 0.071237
x-xss-protection: 1; mode=block
content-length: 24623
date: Wed, 23 Jul 2025 10:21:50 GMT
Bug #21364: Constant lookup in namespaces should be consistent - Ruby - Ruby Issue Tracking System
[ruby-core:122241]
Project
General
Profile
Tags
Custom queries
Actions
Bug #21364
openConstant lookup in namespaces should be consistent
Added by tenderlovemaking (Aaron Patterson) 2 months ago.
Status:
Open
Assignee:
-
Target version:
-
ruby -v:
ruby 3.5.0dev (2025-05-22T23:07:21Z rm-assertion 17e71c7a24) +PRISM [arm64-darwin24]
Description
This might be related to #21363, but I'm not sure.
I expect that a top level Bar
constant should have the same value as Object::Bar
. For example:
File.binwrite("ns.rb", <<-RUBY)
# namespace 3
Bar = 123
module M
def self.test
p Bar: Bar
p "Object::Bar": Object::Bar
end
TEST = -> {
p Bar: Bar
p "Object::Bar": Object::Bar
}
end
RUBY
Bar = 456
ns = Namespace.new
ns.load "./ns.rb"
ns::M.test
ns::M::TEST.call
The output is this:
RUBY_NAMESPACE=1 ./miniruby test.rb
./miniruby: warning: Namespace is experimental, and the behavior may change in the future!
See doc/namespace.md for known issues, etc.
{Bar: 123}
{"Object::Bar": 123}
{Bar: 123}
{"Object::Bar": 456}
But I expected this:
{Bar: 123}
{"Object::Bar": 123}
{Bar: 123}
{"Object::Bar": 123}
Constant lookups in methods seem to behave differently than in lambdas.
No data to display
Actions
Like0
Powered by Redmine © 2006-2025 Jean-Philippe Lang
Loading...