Issue #10687 has been updated by Nobuyoshi Nakada.

Status changed from Open to Closed

----------------------------------------
Bug #10687: ArgumentError in certain cases of instance_exec (new bug in 2.2)
https://bugs.ruby-lang.org/issues/10687#change-62530

* Author: Anonymous
* Status: Closed
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-linux]
* Backport: 
----------------------------------------
a.rb:

~~~

foo = ->(a = nil) do
  p(a)
end
instance_exec(["a", "b", "c", "d"], &foo)
~~~


~~~
#=> rvm use 2.1 && ruby -v && ruby a.rb 
Using /home/micaeked/.rvm/gems/ruby-2.1.5
ruby 2.1.5p273 (2014-11-13 revision 48405) [x86_64-linux]
["a", "b", "c", "d"]
#=> rvm use 2.2 && ruby -v && ruby a.rb 
Using /home/micaeked/.rvm/gems/ruby-2.2.0
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-linux]
a.rb:1:in `block in <main>': wrong number of arguments (4 for 0..1) (ArgumentError)
	from a.rb:5:in `instance_exec'
	from a.rb:5:in `<main>'
~~~


---Files--------------------------------
relaxed.patch (654 Bytes)
test_lambda_relaxed.rb (10.6 KB)


-- 
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>