Bug #13074
closed
When executing instance_exec with symbol.to_proc, it ignores first argument.
Added by alpaca-tc (Hiroyuki Ishii) almost 8 years ago.
Updated almost 8 years ago.
Description
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
- Subject changed from When execute instance_exec with symbol.to_proc, it ignores first argument. to When executing instance_exec with symbol.to_proc, it ignores first argument.
- Status changed from Open to Closed
Applied in changeset r57194.
vm_eval.c: Symbol#to_proc and instance_exec
- Has duplicate Bug #13087: Regression of instance_exec behaviour in ruby 2.4 added
- 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
- Backport changed from 2.1: DONTNEED, 2.2: DONTNEED, 2.3: DONTNEED, 2.4: REQUIRED to 2.1: DONTNEED, 2.2: DONTNEED, 2.3: DONTNEED, 2.4: DONE
ruby_2_4 r57834 merged revision(s) 57194.
- Related to Bug #13370: instance_exec occurs "no receiver given (ArgumentError)" added
Also available in: Atom
PDF
Like0
Like0Like0Like0Like0Like0Like0