summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2024-01-24 13:43:26 -0500
committerKevin Newton <kddnewton@gmail.com>2024-01-24 14:18:25 -0500
commit020fe6e0ca3b7f3b0b35466e7086e809f2ccbcd0 (patch)
tree07d1e3dfb0487f0a91e66ec1847a5d6599cda470 /test/ruby
parentdc8fb7d97ff0113c738bded825a37b3196eeaaae (diff)
[PRISM] Fix forwarding from within block
Fixes ruby/prism#2253.
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_compile_prism.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_compile_prism.rb b/test/ruby/test_compile_prism.rb
index b7aa75a5b0..5ed41569f5 100644
--- a/test/ruby/test_compile_prism.rb
+++ b/test/ruby/test_compile_prism.rb
@@ -2033,6 +2033,14 @@ end
prism_test_forwarding_arguments_node(1,2, 3, ...)
end
CODE
+
+ assert_prism_eval(<<~RUBY)
+ o = Object.new
+ def o.bar(a, b, c) = [a, b, c]
+ def o.foo(...) = 1.times { bar(...) }
+
+ o.foo(1, 2, 3)
+ RUBY
end
def test_ForwardingSuperNode