self.bar inside class Foo and Foo.bar both call a method on the Foo class object, but method_receiver returns different receivers:
class Foo
self.bar # receiver: Foo
end
Foo.bar # receiver: <Foo>
I would expect these to be equivalent, as both target a method on the singleton class of Foo.
Found while pairing on #645 and investigating the behaviour of method_receiver.
self.barinsideclass FooandFoo.barboth call a method on theFooclass object, butmethod_receiverreturns different receivers:I would expect these to be equivalent, as both target a method on the singleton class of
Foo.Found while pairing on #645 and investigating the behaviour of
method_receiver.