Project

General

Profile

Actions

Backport #7843

closed

A weird exception is raised when attempting to remove a "prepend"ed method

Added by mame (Yusuke Endoh) about 11 years ago. Updated about 11 years ago.


Description

Hello,

module P
def m; puts "P"; super; end
end
class A
def m; puts "A"; end
prepend P
remove_method :m
#=> undefined method `method_removed' for #<A:0x007f9e1e825618>
end

Is this intentional?

--
Yusuke Endoh

Updated by matz (Yukihiro Matsumoto) about 11 years ago

No, it must be a bug.

Matz.

Actions #2

Updated by nobu (Nobuyoshi Nakada) about 11 years ago

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

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


vm_method.c: fix method_removed

  • vm_method.c: call method_removed hook on called class, not on
    prepending iclass. [ruby-core:52207] [Bug #7843]
Actions #3

Updated by nagachika (Tomoyuki Chikanaga) about 11 years ago

  • Tracker changed from Bug to Backport
  • Project changed from Ruby master to Backport200
  • Assignee changed from matz (Yukihiro Matsumoto) to nagachika (Tomoyuki Chikanaga)
  • Target version deleted (2.6)
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0