summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2024-01-24 14:41:43 -0500
committerPeter Zhu <peter@peterzhu.ca>2024-01-24 15:18:06 -0500
commit7d61454f2e4dafa19d879b48508bcedba6f28e43 (patch)
tree171030587fe545ad6eec4add499c9a9bd6dad285 /test/ruby
parent94f3f9502c4b0a87392f85672cbc01c7167207d5 (diff)
[PRISM] Fix method calls in keyword arguments
Fixes ruby/prism#2248.
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 7542f0e220..c5b8bd4647 100644
--- a/test/ruby/test_compile_prism.rb
+++ b/test/ruby/test_compile_prism.rb
@@ -2151,6 +2151,14 @@ end
def test_OptionalKeywordParameterNode
assert_prism_eval("def prism_test_optional_keyword_param_node(bar: nil); end")
+
+ # Test with optional argument and method call in OptionalKeywordParameterNode
+ assert_prism_eval(<<~RUBY)
+ o = Object.new
+ def o.foo = 1
+ def o.bar(a = nil, b: foo) = b
+ o.bar
+ RUBY
end
def test_ParametersNode