From: younash@... Date: 2018-04-02T15:24:39+00:00 Subject: [ruby-core:86435] [Ruby trunk Bug#14658] Kernel#singleton_method is incompatible with Module#prepend. Issue #14658 has been reported by nashby (Vasiliy Ermolovich). ---------------------------------------- Bug #14658: Kernel#singleton_method is incompatible with Module#prepend. https://bugs.ruby-lang.org/issues/14658 * Author: nashby (Vasiliy Ermolovich) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: 2.5.0 * Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN ---------------------------------------- It's not possible to get singleton method using Kernel#singleton_method if singleton class was prepended with any module: ~~~ ruby 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. -- https://bugs.ruby-lang.org/ Unsubscribe: