From: mame@ruby-lang.org
To: ruby-core@ruby-lang.org
Subject: [ruby-core:96564] [Ruby master Bug#16465] False keyword warning against Struct#initialize
Date: Sun, 29 Dec 2019 07:53:36 +0000 (UTC) [thread overview]
Message-ID: <redmine.journal-83502.20191229075336.51605f0a47f86178@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-16465.20191229074951@ruby-lang.org
Issue #16465 has been updated by mame (Yusuke Endoh).
It was reported in http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-list/50860
----------------------------------------
Bug #16465: False keyword warning against Struct#initialize
https://bugs.ruby-lang.org/issues/16465#change-83502
* Author: mame (Yusuke Endoh)
* Status: Open
* Priority: Normal
* Assignee: jeremyevans0 (Jeremy Evans)
* Target version:
* ruby -v: ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
The following code is warned:
```ruby
Sample2 = Struct.new(:s1, :s2, :s3) do
def initialize(a1:, a2:)
super(a1, a2, a1 + a2)
end
end
p Sample2.new(a1:1, a2:2)
#=> test.rb:6: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
#=> test.rb:2: warning: The called method `initialize' is defined here
```
I think the code is innocent and the warning is false positive. I'll create a pull request.
--
https://bugs.ruby-lang.org/
next prev parent reply other threads:[~2019-12-29 7:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <redmine.issue-16465.20191229074951@ruby-lang.org>
2019-12-29 7:49 ` [ruby-core:96563] [Ruby master Bug#16465] False keyword warning against Struct#initialize mame
2019-12-29 7:53 ` mame [this message]
2019-12-29 8:04 ` [ruby-core:96565] " mame
2019-12-29 8:30 ` [ruby-core:96566] " nobu
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.journal-83502.20191229075336.51605f0a47f86178@ruby-lang.org \
--to=ruby-core@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).