From 529700d3145cc77271a70bc75ab91528b7a7b084 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Tue, 23 Jan 2024 11:32:35 -0500 Subject: [PRISM] Nested MultiWriteNode with method calls Fixes ruby/prism#2247. --- test/ruby/test_compile_prism.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_compile_prism.rb b/test/ruby/test_compile_prism.rb index 682f50d1d6..6a30854ba8 100644 --- a/test/ruby/test_compile_prism.rb +++ b/test/ruby/test_compile_prism.rb @@ -653,6 +653,21 @@ module Prism foo = Foo.new _, foo.bar, _, foo.baz = 1 CODE + + # Test nested writes with method calls + assert_prism_eval(<<~RUBY) + class Foo + attr_accessor :bar + end + + a = Foo.new + + (a.bar, a.bar), b = [1], 2 + RUBY + assert_prism_eval(<<~RUBY) + h = {} + (h[:foo], h[:bar]), a = [1], 2 + RUBY end ############################################################################ -- cgit v1.2.3