aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_lambda.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-19 01:11:12 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-19 01:11:12 +0000
commit976becf7eb18aa1592c703ac4d86a2cf9dfa701e (patch)
treeea2cf60b1ebf58b756e896484440036f5f3ba2cd /test/ruby/test_lambda.rb
parenta9d575e507e1ce181ed71b9a7d4c3ad4f2f23e59 (diff)
downloadruby-976becf7eb18aa1592c703ac4d86a2cf9dfa701e.tar.gz
vm_args.c: arity check of lambda
* vm_eval.c (rb_yield_lambda): new function which yields an array to a proc and splat to a lambda. mainly for Enumerable only. * vm_args.c (setup_parameters_complex): remove special lambda splatting for [Bug #9605]. [ruby-core:77065] [Bug #12705] * vm_insnhelper.c (vm_callee_setup_block_arg): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58019 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_lambda.rb')
-rw-r--r--test/ruby/test_lambda.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_lambda.rb b/test/ruby/test_lambda.rb
index 826bfcf203..3ac2e4cb98 100644
--- a/test/ruby/test_lambda.rb
+++ b/test/ruby/test_lambda.rb
@@ -101,6 +101,12 @@ class TestLambdaParameters < Test::Unit::TestCase
assert_equal(:ok, x, bug13090)
end
+ def test_arity_error
+ assert_raise(ArgumentError, '[Bug #12705]') do
+ [1, 2].tap(&lambda {|a, b|})
+ end
+ end
+
def foo
assert_equal(nil, ->(&b){ b }.call)
end