From: usa@... Date: 2018-10-17T09:25:16+00:00 Subject: [ruby-core:89443] [Ruby trunk Bug#14658] Kernel#singleton_method is incompatible with Module#prepend. Issue #14658 has been updated by usa (Usaku NAKAMURA). Backport changed from 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: DONE to 2.3: UNKNOWN, 2.4: DONE, 2.5: DONE ruby_2_4 r65118 merged revision(s) 63067,63068. ---------------------------------------- Bug #14658: Kernel#singleton_method is incompatible with Module#prepend. https://bugs.ruby-lang.org/issues/14658#change-74481 * Author: nashby (Vasiliy Ermolovich) * Status: Closed * Priority: Normal * Assignee: * Target version: * ruby -v: 2.5.0 * Backport: 2.3: UNKNOWN, 2.4: DONE, 2.5: DONE ---------------------------------------- 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. ---Files-------------------------------- fix_singleton-method-prepend.patch (1.88 KB) -- https://bugs.ruby-lang.org/ Unsubscribe: