Project

General

Profile

Bug #4058

__method__ does not return correct method name for aliased methods

Added by banister (john mair) almost 7 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.2p0 (2010-08-18) [i386-mingw32]
[ruby-core:33189]

Description

=begin
class Test
def my_method
method
end

alias_method :my_alias, :my_method
end

Hello.new.my_method #=> :my_method
Hello.new.my_alias #=> :my_method

I think that Hello.new.my_alias should instead return :my_alias
=end

History

#1 Updated by runpaint (Run Paint Run Run) almost 7 years ago

=begin
This is intended. Originally, callee and method were equivalent, except in aliased methods where the former returned the aliased name, and the latter returned the non-aliased name. Then, later, matz changed callee_ to be identical to __method.
=end

#2 Updated by runpaint (Run Paint Run Run) over 6 years ago

=begin

This is intended. Originally, callee and method were equivalent, except in aliased methods where the former returned the
aliased name, and the latter returned the non-aliased name. Then, later, matz changed callee_ to be identical to __method.

Proof I'm not making this up: http://redmine.ruby-lang.org/repositories/revision/ruby-19?rev=14448 ;-). This can be closed.
=end

#3 [ruby-core:37437] Updated by naruse (Yui NARUSE) about 6 years ago

  • Status changed from Open to Closed

#4 [ruby-core:38345] Updated by charlton (Charlton Wang) about 6 years ago

Is there any hope of getting callee functionality back at some point? I tried to write a ruby extension that provided a function to call what used to be called by callee but that doesn't appear to work. Has the VM changed to the point where we'll never get this functionality back?

Also available in: Atom PDF