Bug #7806

Updated by Nobuyoshi Nakada over 2 years ago

=begin
it seems that Method#inspect does some magic with alias methods

code:
class

(({class
A

def xyz

end

alias ver xyz

end



p A.instance_method(:ver) #<UnboundMethod: A#xyz>

p A.instance_method(:ver).name #:ver



a=A.new

p a.method(:ver) #<Method: A#xyz>

p a.method(:ver).name #:ver
}))


shouldn't the #(({inspect})) #inspect method use the #(({name})) #name one?

maybe #(({alias?})) #alias? and #(({alias_target})) #alias_target and maybe (({inspect})) inspect return something like ((%#<Method: A#ver(xyz)>%)) #&lt;Method: A#ver(xyz)&gt; so it can be seen that the method is an alias?

PS: sorry i cant get the code tag working currectly

Back