Forum: Ruby-core Refinment doesn't update #methods

F1d6cc2b735bfd82c8773172da2aeab9?d=identicon&s=25 Nobuyoshi Nakada (nobu)
on 2013-09-10 05:39
(Received via mailing list)
Issue #8881 has been updated by nobu (Nobuyoshi Nakada).

Description updated
Backport changed from 1.9.3: UNKNOWN, 2.0.0: UNKNOWN to 1.9.3: DONTNEED,
2.0.0: REQUIRED
ruby -v set to r42901

It should be `instance_methods', not `methods'.
----------------------------------------
Bug #8881:  Refinment doesn't update #methods
https://bugs.ruby-lang.org/issues/8881#change-41705

Author: minad (Daniel Mendler)
Status: Open
Priority: Normal
Assignee:
Category:
Target version:
ruby -v: r42901
Backport: 1.9.3: DONTNEED, 2.0.0: REQUIRED


=begin
Hi,

the refinements don't respect #methods. Consider the following:

 Object.methods.include?(:foo) # returns false
 Module.methods.include?(:foo) # returns false

 module Test
   refine Object do
     def foo; end
   end
 end

 puts Object.methods.include?(:foo)# returns true
 puts Module.methods.include?(:foo)# returns true

 Object.new.foo # Exception

Daniel Mendler
=end
This topic is locked and can not be replied to.