From: "ozydingo (Andrew Schwartz) via ruby-core" <ruby-core@ml.ruby-lang.org>
To: ruby-core@ml.ruby-lang.org
Cc: "ozydingo (Andrew Schwartz)" <noreply@ruby-lang.org>
Subject: [ruby-core:117631] [Ruby master Misc#20441] Should passing keyword args to method_name(*) be an error?
Date: Sun, 21 Apr 2024 08:25:22 +0000 (UTC) [thread overview]
Message-ID: <redmine.issue-20441.20240421082521.10397@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-20441.20240421082521.10397@ruby-lang.org
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/
next parent reply other threads:[~2024-04-21 8:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-21 8:25 ozydingo (Andrew Schwartz) via ruby-core [this message]
2024-04-21 8:33 ` [ruby-core:117632] [Ruby master Misc#20441] Should passing keyword args to method_name(*) be an error? zverok (Victor Shepelev) via ruby-core
2024-04-21 8:47 ` [ruby-core:117633] " ozydingo (Andrew Schwartz) via ruby-core
2024-04-21 8:58 ` [ruby-core:117634] " zverok (Victor Shepelev) via ruby-core
2024-04-21 14:33 ` [ruby-core:117635] " ozydingo (Andrew Schwartz) via ruby-core
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.ruby-lang.org/en/community/mailing-lists/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=redmine.issue-20441.20240421082521.10397@ruby-lang.org \
--to=ruby-core@ruby-lang.org \
--cc=noreply@ruby-lang.org \
--cc=ruby-core@ml.ruby-lang.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).