I've found the need for something like this as well, I have a use case where it's getting repetitive and distractingly verbose to build out the `Data` blocks just for a number of defaults. The mutable defaults is a really good point, tho...ozydingo (Andrew Schwartz)
Understanding better the role of `ruby2_keywords` is helping, thank you. It seemed to me that either way some compatibility was broken, but the subtleties of maintaining compatibility as well as possible in a variety of circumstances is ...ozydingo (Andrew Schwartz)
Why does this conversion to a Hash occur? I would guess for some sense of backward compatibility with gems / code written in earlier versions of Ruby. But #20440 demonstrates why this compatibility is not achieved. To be clear, I'm no...ozydingo (Andrew Schwartz)
In the following method: ```rb def foo(*) super end ``` it is apparently the intended ruby 3 behavior to pass keyword args as a positional Hash to `super`. I believe this is confusing and can lead to hidden and hard-to-discov...ozydingo (Andrew Schwartz)
Ok I see it now; `super` isn't passing the args as both forms, it's passing _only_ as a positional Hash. The `x: 1` is coming from my default kwarg, which I was blinded to as I attempted to reduce the example to a general form. Thanks all!ozydingo (Andrew Schwartz)
Thanks both. I understand that Ruby 3 requires explicit handling of keyword arguments. What still seems off to me is that `super` is _modifying_ the arguments. The child method is being passed a keyword argument, and `super` is forwardin...ozydingo (Andrew Schwartz)
In fact it seems we can simplify this to just calling `Child.new.foo(x: 1)`; no need for the base class `foo!` method. ```rb Child.new.foo(x: 1) Child: calling foo Base: calling foo with args: [{:x=>1}], x: 1 ``` Apologies if I'm misu...ozydingo (Andrew Schwartz)
Apologies for the verbose title, but that's the specific set of conditions that AFAICT are required to reproduce the bug! Here's the simplest setup I can reproduce: ```rb class Base def foo(*args, x: 1) puts "Base: calling...ozydingo (Andrew Schwartz)
Reproduced on ruby:3.3 docker container The evaluation of `**{}` differs if it appears alone (evaluates as empty / no content) in an array vs after another element (evaluates as an empty Hash). ```rb args = []; kwargs = {} [*args...ozydingo (Andrew Schwartz)
Adding to this, the current behavior results in the following inconsistent behavior: I can call an argless method using a double-splatted empty Hash directly, but this cannot be done via a delegating or overriding method. I'm encounterin...ozydingo (Andrew Schwartz)