summaryrefslogtreecommitdiff
path: root/bootstraptest/test_method.rb
diff options
context:
space:
mode:
Diffstat (limited to 'bootstraptest/test_method.rb')
-rw-r--r--bootstraptest/test_method.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/bootstraptest/test_method.rb b/bootstraptest/test_method.rb
index 2baf33539d..d6b8c0ea24 100644
--- a/bootstraptest/test_method.rb
+++ b/bootstraptest/test_method.rb
@@ -1184,3 +1184,23 @@ assert_equal 'ok', %q{
'ok'
}, '[ruby-core:30534]'
+# should not cache when splat
+assert_equal 'ok', %q{
+ class C
+ attr_reader :a
+ def initialize
+ @a = 1
+ end
+ end
+
+ def m *args
+ C.new.a(*args)
+ end
+
+ m()
+ begin
+ m(1)
+ rescue ArgumentError
+ 'ok'
+ end
+}