Actions
Bug #17179
closedUnexpected warning during value assignment to setter
Bug #17179:
Unexpected warning during value assignment to setter
Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-darwin19]
Description
some_instance = Class.new { def some_setter=(a:, b:); end }.new
setter_params = { a: 1, b: 2 }
some_instance.some_setter = setter_params # => {:a=>1, :b=>2}
# warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
# warning: The called method `some_setter=' is defined here
some_instance.public_send(:some_setter=, **setter_params) # => nil
# No warninigs, everything is ok
If this behavior is okay, probably we need to add the ability to use the double splat operator with syntax sugar like in example below:
some_instance.some_setter = **setter_params
Actions