Issue #9403 has been updated by Yui NARUSE.

Status changed from Assigned to Closed

Applied in changeset r44794.

----------
merge revision(s) 44630,44631: [Backport #9403]

	* lib/delegate.rb (Delegator): keep source information methods
	  which start and end with '__'.  [ruby-core:58572] [Bug #9155]
	  which start and end with '__'.  [ruby-core:59718] [Bug #9403]

----------------------------------------
Backport #9403: Incorrect __callee__ in delegate classes
https://bugs.ruby-lang.org/issues/9403#change-44889

* Author: Avdi Grimm
* Status: Closed
* Priority: Normal
* Assignee: Yui NARUSE
* Category: 
* Target version: 
* ruby -v: ruby 2.2.0dev (2014-01-12 trunk 44574) [x86_64-linux]
----------------------------------------
`__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)


-- 
http://bugs.ruby-lang.org/