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

Updated by nobu (Nobuyoshi Nakada) almost 9 years ago

  • Description updated (diff)
  • Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN to 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: DONTNEED, 2.3: REQUIRED
Actions #2

Updated by nobu (Nobuyoshi Nakada) almost 9 years ago

  • Has duplicate Bug #12058: Unexpected value of __callee__ when including a module added
Actions #3

Updated by nobu (Nobuyoshi Nakada) almost 9 years ago

  • Related to Bug #12176: method equality of aliased methods breakage on 2.3 added

Updated by noahgibbs (Noah Gibbs) over 8 years ago

Looks like this broke in r51126 (GitHub rev 5e8a147480f87f19a8b96ad3fb33a25fb4bb19b9).

Updated by usa (Usaku NAKAMURA) over 8 years ago

  • Status changed from Open to Assigned
  • Assignee set to ko1 (Koichi Sasada)
Actions #6

Updated by shyouhei (Shyouhei Urabe) over 8 years ago

  • Related to Bug #12761: Ruby 2.3.1 has a bug in `Module#alias` and `Module#alias_method` added

Updated by nobu (Nobuyoshi Nakada) almost 8 years ago

  • Status changed from Assigned to Closed

Seems fixed by r56592.

Updated by nagachika (Tomoyuki Chikanaga) over 7 years ago

  • Backport changed from 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: DONTNEED, 2.3: REQUIRED to 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: DONTNEED, 2.3: DONE

ruby_2_3 r58148 merged revision(s) 56592.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0