[ruby-core:78962] [Ruby trunk Bug#13074] When executing instance_exec with symbol.to_proc, it ignores first argument.

From: naruse@...
Date: 2017-01-04 00:45:42 UTC
List: ruby-core #78962
Issue #13074 has been updated by Yui NARUSE.

Backport changed from 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN to 2.1: DONTNEED, 2.2: DONTNEED, 2.3: DONTNEED, 2.4: REQUIRED

----------------------------------------
Bug #13074: When executing instance_exec with symbol.to_proc, it ignores first argument.
https://bugs.ruby-lang.org/issues/13074#change-62381

* Author: Hiroyuki Ishii
* Status: Closed
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 
* Backport: 2.1: DONTNEED, 2.2: DONTNEED, 2.3: DONTNEED, 2.4: REQUIRED
----------------------------------------
Is this intentional?

```
# Ruby 2.3.3
束 instance_exec(1) { |i| i.itself }
=> 1
束 instance_exec(1, &:itself)
=> 1

# Ruby 2.4.0
束 instance_exec(1) { |i| i.itself }
=> 1
束 instance_exec(1, &:itself)
=> main
```



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

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next