Project

General

Profile

Actions

Bug #11964

closed

__callee__ in aliased methods defined in a module returns an incorrect value

Added by Anonymous almost 9 years ago. Updated over 7 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]
[ruby-core:72741]

Description

With Ruby 2.3, instead of following snippet printing bar (as it does with ruby 2.2.4) it prints foo.
If the methods are defined within the class instead of an included module, the snippet prints bar.

module Mod
  def foo
    __callee__
  end
  alias_method :bar, :foo
end

class Klass
  include Mod
end

a = Klass.new
p a.bar

This appears to be the behavior for both 2.3.0 and ruby 2.3.0dev (2015-11-12 trunk 52550) [x86_64-linux]


Related issues 3 (0 open3 closed)

Related to Ruby master - Bug #12176: method equality of aliased methods breakage on 2.3ClosedActions
Related to Ruby master - Bug #12761: Ruby 2.3.1 has a bug in `Module#alias` and `Module#alias_method`ClosedActions
Has duplicate Ruby master - Bug #12058: Unexpected value of __callee__ when including a moduleClosedActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0