From: "ozydingo (Andrew Schwartz) via ruby-core" Date: 2024-04-21T08:25:22+00:00 Subject: [ruby-core:117631] [Ruby master Misc#20441] Should passing keyword args to method_name(*) be an error? Issue #20441 has been reported by ozydingo (Andrew Schwartz). ---------------------------------------- Misc #20441: Should passing keyword args to method_name(*) be an error? https://bugs.ruby-lang.org/issues/20441 * Author: ozydingo (Andrew Schwartz) * Status: Open ---------------------------------------- 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-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(**)`. -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/