Project

General

Profile

Actions

Bug #4058

closed

__method__ does not return correct method name for aliased methods

Added by banister (john mair) almost 14 years ago. Updated over 13 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.2p0 (2010-08-18) [i386-mingw32]
Backport:
[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

Actions #1

Updated by runpaint (Run Paint Run Run) almost 14 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

Actions #2

Updated by runpaint (Run Paint Run Run) almost 14 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

Updated by naruse (Yui NARUSE) over 13 years ago

  • Status changed from Open to Closed

Updated by charlton (Charlton Wang) over 13 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?

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0