diff options
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_compile_prism.rb | 15 |
1 files changed, 15 insertions, 0 deletions
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 ############################################################################ |
