Project

General

Profile

Bug #11964

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

Added by sinuhe (Sinuhe Hardegree) over 3 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Normal
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

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

Associated revisions

Revision 56592
Added by ktsj (Kazuki Tsujimoto) over 2 years ago

  • eval.c, method.h, proc.c, vm.c, vm_eval.c, vm_insnhelper.c, vm_method.c:
    TracePoint#method_id should return method_id, not callee_id.
    [ruby-core:77241] [Feature #12747]

  • test/ruby/test_settracefunc.rb: change accordingly.

Revision f8f026c4
Added by nagachika (Tomoyuki Chikanaga) about 2 years ago

merge revision(s) 56592: [Backport #11964]

* eval.c, method.h, proc.c, vm.c, vm_eval.c, vm_insnhelper.c, vm_method.c:
  TracePoint#method_id should return method_id, not callee_id.
  [ruby-core:77241] [Feature #12747]

* test/ruby/test_settracefunc.rb: change accordingly.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 58148
Added by nagachika (Tomoyuki Chikanaga) about 2 years ago

merge revision(s) 56592: [Backport #11964]

* eval.c, method.h, proc.c, vm.c, vm_eval.c, vm_insnhelper.c, vm_method.c:
  TracePoint#method_id should return method_id, not callee_id.
  [ruby-core:77241] [Feature #12747]

* test/ruby/test_settracefunc.rb: change accordingly.

History

Updated by nobu (Nobuyoshi Nakada) about 3 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
#2

Updated by nobu (Nobuyoshi Nakada) about 3 years ago

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

Updated by nobu (Nobuyoshi Nakada) about 3 years ago

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

Updated by noahgibbs (Noah Gibbs) almost 3 years ago

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

Updated by usa (Usaku NAKAMURA) almost 3 years ago

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

Updated by shyouhei (Shyouhei Urabe) over 2 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) over 2 years ago

  • Status changed from Assigned to Closed

Seems fixed by r56592.

Updated by nagachika (Tomoyuki Chikanaga) about 2 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.

Also available in: Atom PDF