From 2c07970dd7b4f1388c41cfc66bb52da7cbee393c Mon Sep 17 00:00:00 2001 From: nagachika Date: Thu, 18 Aug 2016 14:03:36 +0000 Subject: merge revision(s) 55609: [Backport #12568] * vm_args.c (setup_parameters_complex): don't raise ArgumentError if an array is given for instance_exec with optional argument. [ruby-core:76300] [Bug #12568] https://github.com/rails/rails/pull/25699 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@55956 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_lambda.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/ruby/test_lambda.rb') diff --git a/test/ruby/test_lambda.rb b/test/ruby/test_lambda.rb index f61e8a9f62..597da8a819 100644 --- a/test/ruby/test_lambda.rb +++ b/test/ruby/test_lambda.rb @@ -72,6 +72,13 @@ class TestLambdaParameters < Test::Unit::TestCase assert_raise(ArgumentError, bug9605) {proc(&plus).call [1,2]} end + def test_instance_exec + bug12568 = '[ruby-core:76300] [Bug #12568]' + assert_nothing_raised(ArgumentError, bug12568) do + instance_exec([1,2,3], &->(a=[]){ a }) + end + end + def yield_1(arg) yield arg end -- cgit v1.2.3