Actions
Bug #16764
closedModule.const_source_location does not work on autoloaded constants
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-darwin19]
Backport:
Description
As we found when trying out const_source_location
on a Rails project, it breaks when used on autoloaded constants.
Example:
$ cat foo.rb
autoload :Bar, './bar'
Bar
puts Module.const_source_location("Bar")
Returns foo.rb:3
, when it should return bar.rb:1
.
Actions
Like0
Like0Like0Like0Like0