Project

General

Profile

Actions

Backport #9403

closed

Incorrect __callee__ in delegate classes

Added by avdi (Avdi Grimm) almost 11 years ago. Updated almost 11 years ago.

Status:
Closed
[ruby-core:<unknown>]

Description

__callee__ always contains the value :call in any method of a class derived from Delegator. This is new behavior in 2.1, and is present in trunk.

Using the attached script, here's the output on 1.9.3, 2.0, 2.1, and trunk:

Ruby 1.9.3
__callee__ in Proxy#foo: foo
__callee__ in Target#foo: foo
__callee__ in DelegateClassProxy#foo: foo
__callee__ in Target#foo: foo
Ruby 2.0.0
__callee__ in Proxy#foo: foo
__callee__ in Target#foo: foo
__callee__ in DelegateClassProxy#foo: foo
__callee__ in Target#foo: foo
Ruby 2.1.0
__callee__ in Proxy#foo: call
__callee__ in Target#foo: foo
__callee__ in DelegateClassProxy#foo: call
__callee__ in Target#foo: foo
Ruby 2.2.0
__callee__ in Proxy#foo: call
__callee__ in Target#foo: foo
__callee__ in DelegateClassProxy#foo: call
__callee__ in Target#foo: foo

Files

delegate-callee.rb (452 Bytes) delegate-callee.rb avdi (Avdi Grimm), 01/12/2014 06:27 PM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0