Backport #8881

Refinment doesn't update #methods

Added by Daniel Mendler almost 2 years ago. Updated almost 2 years ago.

[ruby-core:57080]
Status:Closed
Priority:Normal
Assignee:Tomoyuki Chikanaga

Description

=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

Associated revisions

Revision 42903
Added by Nobuyoshi Nakada almost 2 years ago

class.c: exclude refined methods

  • class.c (method_entry_i): should exclude refined methods from instance method list. [Bug #8881]

Revision 42924
Added by Tomoyuki Chikanaga almost 2 years ago

merge revision(s) 42903: [Backport #8881]

* class.c (method_entry_i): should exclude refined methods from
  instance method list.   [Bug #8881]

History

#1 Updated by Nobuyoshi Nakada almost 2 years ago

  • Description updated (diff)
  • 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', notmethods'.

#2 Updated by Nobuyoshi Nakada almost 2 years ago

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

This issue was solved with changeset r42903.
Daniel, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


class.c: exclude refined methods

  • class.c (method_entry_i): should exclude refined methods from instance method list. [Bug #8881]

#3 Updated by Tomoyuki Chikanaga almost 2 years ago

  • Tracker changed from Bug to Backport
  • Project changed from Ruby trunk to Backport200
  • Status changed from Closed to Assigned
  • Assignee set to Tomoyuki Chikanaga

#4 Updated by Tomoyuki Chikanaga almost 2 years ago

  • Status changed from Assigned to Closed

This issue was solved with changeset r42924.
Daniel, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


merge revision(s) 42903: [Backport #8881]

* class.c (method_entry_i): should exclude refined methods from
  instance method list.   [Bug #8881]

Also available in: Atom PDF