Bug #8044

Object#methods incompatible with prepend

Added by Marc-Andre Lafortune about 1 year ago. Updated about 1 year ago.

[ruby-core:53207]
Status:Closed
Priority:Normal
Assignee:-
Category:core
Target version:2.1.0
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 about 1 year ago

class.c: from the origin class

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

History

#1 Updated by Marc-Andre Lafortune about 1 year ago

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

#2 Updated by Nobuyoshi Nakada about 1 year 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 (rbobjsingleton_methods): collect methods from the origin class. [Bug #8044]

Also available in: Atom PDF