summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2024-01-23 14:43:53 -0500
committerPeter Zhu <peter@peterzhu.ca>2024-01-23 15:23:13 -0500
commitcecf42601aa4170aa2336dbb3ffc7753e86e6115 (patch)
tree11a14a3e34a9a8589ab3a2147e7a83706cb8cf25 /test/ruby
parent333f4b4930bf397f87bd99767b53fcce4f9a3e43 (diff)
[PRISM] Fix block fowarding
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_compile_prism.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_compile_prism.rb b/test/ruby/test_compile_prism.rb
index 66fbefd27b..8357914ce2 100644
--- a/test/ruby/test_compile_prism.rb
+++ b/test/ruby/test_compile_prism.rb
@@ -1690,6 +1690,15 @@ end
def test_BlockArgumentNode
assert_prism_eval("1.then(&:to_s)")
+
+ # Test forwarding with no name
+ assert_prism_eval(<<~RUBY)
+ o = Object.new
+ def o.foo(&) = yield
+ def o.bar(&) = foo(&)
+
+ o.bar { :ok }
+ RUBY
end
def test_BlockLocalVariableNode