diff options
author | Jeremy Evans <code@jeremyevans.net> | 2020-12-22 21:30:32 -0800 |
---|---|---|
committer | Jeremy Evans <code@jeremyevans.net> | 2020-12-23 19:29:19 -0800 |
commit | 1e215a66d26d56befab4fbb72e1d953879411955 (patch) | |
tree | 1633af4390f554711ca04b50566f544d84ee9f9e /test/nkf/test_nkf.rb | |
parent | 9aca51e8a597fb4689c058b4e6b215ae87434e1b (diff) |
Fix class of method in Method#inspect for singleton classes of classes
Previously, due to a change to fix bug 15608, Method#inspect output
changed for class methods:
Ruby 2.7
"#<Method: String.prepend(*)>"
Before change:
"#<Method: #<Class:Object>(Module)#prepend(*)>"
This is wrong because the Method object was created from String and
not Object. This is because the fix for bug 15608 assumed it was
being called on the singleton class of a instance, and would skip
the first singleton class until it got to the class itself. For
class methods, this results in always using the superclass. Fix
behavior to not skip until the superclass if the singleton class
is the singleton class of a module or class.
After change:
"#<Method: #<Class:Object>(Module)#prepend(*)>"
Fixes [Bug #17428]
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3984
Diffstat (limited to 'test/nkf/test_nkf.rb')
0 files changed, 0 insertions, 0 deletions