Project

General

Profile

Bug #13074

When executing instance_exec with symbol.to_proc, it ignores first argument.

Added by alpaca-tc (Hiroyuki Ishii) over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:78839]

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

Related issues

Related to Ruby master - Bug #13370: instance_exec occurs "no receiver given (ArgumentError)"RejectedActions
Has duplicate Ruby master - Bug #13087: Regression of instance_exec behaviour in ruby 2.4ClosedActions

Also available in: Atom PDF