Project

General

Profile

Actions

Bug #11188

closed

Method#inspect for chaining alias methods

Added by ko1 (Koichi Sasada) almost 9 years ago. Updated almost 4 years ago.

Status:
Closed
Target version:
-
[ruby-core:69388]
Tags:

Description

The following script prints strange results (at least for me).

class C0
  def foo
  end
end

class C1 < C0
  alias foo1 foo
  alias foo2 foo1
  alias foo3 foo2
end

p C1.new.method(:foo)
p C1.new.method(:foo1)
p C1.new.method(:foo2)
p C1.new.method(:foo3)

Result:

#<Method: C1(C0)#foo>
#<Method: C1(C0)#foo1(foo)>
#<Method: C1#foo2(foo)>
#<Method: C1#foo3(foo)>

I believe 3rd and 4th results should be:

#<Method: C1(C0)#foo2(foo)>
#<Method: C1(C0)#foo3(foo)>

How about it?


Files

method-inspect-chain-alias-11188.patch (2.37 KB) method-inspect-chain-alias-11188.patch jeremyevans0 (Jeremy Evans), 08/12/2019 10:21 PM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0