diff options
author | Jean Boussier <byroot@ruby-lang.org> | 2024-01-16 09:33:16 +0100 |
---|---|---|
committer | Jean Boussier <jean.boussier@gmail.com> | 2024-03-13 09:39:09 +0100 |
commit | a5c5f83b24a1b7024d4e7fe3bbce091634da53b2 (patch) | |
tree | 934bf77f4320f75e5e72beaae89300b296f9306d /spec/ruby/core/module/fixtures | |
parent | 0b7487b44ecc0f95dcc8bfa0fdf7d5915dcc0f8f (diff) |
Make `const_source_location` return the real constant as soon as defined
[Bug #20188]
Ref: https://github.com/fxn/zeitwerk/issues/281#issuecomment-1893228355
Previously, it would only return the real constant location once the
autoload was fully completed.
Diffstat (limited to 'spec/ruby/core/module/fixtures')
-rw-r--r-- | spec/ruby/core/module/fixtures/autoload_const_source_location.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/ruby/core/module/fixtures/autoload_const_source_location.rb b/spec/ruby/core/module/fixtures/autoload_const_source_location.rb new file mode 100644 index 0000000000..ee0e5a689f --- /dev/null +++ b/spec/ruby/core/module/fixtures/autoload_const_source_location.rb @@ -0,0 +1,6 @@ +module ConstantSpecs + BEFORE_DEFINE_LOCATION = const_source_location(:ConstSource) + module ConstSource + LOCATION = Object.const_source_location(name) + end +end |