From d07fdc5edee219bbbd6262f909d636a509793cca Mon Sep 17 00:00:00 2001 From: Ufuk Kayserilioglu Date: Thu, 14 Dec 2023 20:15:30 +0200 Subject: [PRISM] Fix keyword hash handling in method calls * Start using the renamed `PM_KEYWORD_HASH_NODE_FLAGS_SYMBOL_KEYS` flag to check if all keys of the keyword hash node are symbols. * For arguments passed as a hash, start marking them as `KW_SPLAT_MUT` only if the number of entries in the hash is greater than 1 (which is what the old compiler used to do). --- test/ruby/test_compile_prism.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_compile_prism.rb b/test/ruby/test_compile_prism.rb index e01344ccc5..6b16205869 100644 --- a/test/ruby/test_compile_prism.rb +++ b/test/ruby/test_compile_prism.rb @@ -1447,6 +1447,18 @@ module Prism prism_opt_var_trail_hash("a", "b", "c", "c" => 0, c: 1) CODE + assert_prism_eval(<<-CODE) + def self.foo(*args, **kwargs) = [args, kwargs] + + [ + foo(2 => 3), + foo([] => 42), + foo(a: 42, b: 61), + foo(1, 2, 3, a: 42, "b" => 61), + foo(:a => 42, :b => 61), + ] + CODE + assert_prism_eval(<<-CODE) class PrivateMethod def initialize -- cgit v1.2.3