Bug #8044

Object#methods incompatible with prepend

Added by Marc-Andre Lafortune over 2 years ago. Updated over 2 years ago.

[ruby-core:53207]
Status:Closed
Priority:Normal
Assignee:-
ruby -v:r39608 Backport:

Description

Object#methods incompatible with prepend:

o = Object.new
def o.foo; end
o.methods(false) # => [:foo], ok
o.singleton_class.send :prepend, Enumerable
o.methods(false) # => [], should be [:foo]

Related issues

Duplicated by Ruby trunk - Bug #8045: Object#singleton_methods incompatible with prepend Closed 03/08/2013

Associated revisions

Revision 39744
Added by Nobuyoshi Nakada over 2 years ago

class.c: from the origin class

  • class.c (rb_obj_singleton_methods): collect methods from the origin class. [Bug #8044]

Revision 39744
Added by Nobuyoshi Nakada over 2 years ago

class.c: from the origin class

  • class.c (rb_obj_singleton_methods): collect methods from the origin class. [Bug #8044]

History

#1 Updated by Marc-Andre Lafortune over 2 years ago

{public|protected|private}methods have the same problem, since they all call classinstance_method_list

#2 Updated by Nobuyoshi Nakada over 2 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r39744.
Marc-Andre, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


class.c: from the origin class

  • class.c (rb_obj_singleton_methods): collect methods from the origin class. [Bug #8044]

Also available in: Atom PDF