Ruby 3.0 hash and keyword argument separation compatibility
0 reputation · 28 Apr 2026, 21:20 UTC
In Ruby 3.0, the interpreter no longer automatically converts positional hashes into keyword arguments. While Ruby 2.7 allowed passing a hash as the final positional argument to a method defined with keyword parameters—often triggering only a deprecation warning—later versions enforce a strict boundary.
This change was implemented to clarify API interfaces and improve internal performance. However, legacy codebases that rely on this implicit conversion without using the double-splat (**) operator will now encounter ArgumentError at runtime.
What are the performance implications of using the double-splat operator when passing large hashes to methods with multiple mandatory keyword arguments? Are there specific edge cases where explicit deconstruction fails to replicate the original Ruby 2.7 behavior exactly?