Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Method#owner for alias methods doesn't include prepended modules, breaking equality #5080
I've tested this on 126.96.36.199 and the latest master.
Given the following code, I'd expect a method's owner to be equal to the class where the method is defined.
class FakeClass prepender = Module.new prepend prepender def fake_method end alias_method :other_fake_method, :fake_method end
Both of these lines should return true:
FakeClass.instance_method(:fake_method).owner == FakeClass FakeClass.instance_method(:other_fake_method).owner == FakeClass
The second line returns false:
I think it's because the
I've also tested this on MRI 2.3.1 and 2.4.3 and they behave as expected.