Actions
Misc #20441
closedShould passing keyword args to method_name(*) be an error?
Status:
Closed
Assignee:
-
Description
In the following method:
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-discover bugs (e.g. #20440). Since *
is meant to only represent positional args, should it be an ArgumentError to pass keyword args at all to this method? Similar to how it is an error to pass positions args to bar(**)
.
Actions
Like0
Like0Like0Like0Like0Like0