Actions
Bug #14658
closedKernel#singleton_method is incompatible with Module#prepend.
Bug #14658:
Kernel#singleton_method is incompatible with Module#prepend.
Description
It's not possible to get singleton method using Kernel#singleton_method if singleton class was prepended with any module:
module Empty; end
class MyClass
singleton_class.prepend(Empty)
def self.foo; end
end
MyClass.singleton_methods(false) # => [:foo]
MyClass.singleton_method(:foo) # => NameError (undefined singleton method `foo' for `MyClass')
Attached patch fixes it.
Files
Actions