From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-4.1 required=3.0 tests=AWL,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id 0534C1F463 for ; Sun, 29 Dec 2019 08:05:01 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 42029120B15; Sun, 29 Dec 2019 17:04:47 +0900 (JST) Received: from xtrwkhkc.outbound-mail.sendgrid.net (xtrwkhkc.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id CD2A5120AF8 for ; Sun, 29 Dec 2019 17:04:44 +0900 (JST) Received: by filterdrecv-p3mdw1-56c97568b5-2vkp8 with SMTP id filterdrecv-p3mdw1-56c97568b5-2vkp8-20-5E085E21-1C 2019-12-29 08:04:49.419258949 +0000 UTC m=+1063302.661849614 Received: from herokuapp.com (unknown [54.145.162.235]) by ismtpd0091p1iad2.sendgrid.net (SG) with ESMTP id n0LLUldiRCyWS_05OYRlpg for ; Sun, 29 Dec 2019 08:04:49.387 +0000 (UTC) Date: Sun, 29 Dec 2019 08:04:49 +0000 (UTC) From: mame@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 72224 X-Redmine-Project: ruby-master X-Redmine-Issue-Id: 16465 X-Redmine-Issue-Author: mame X-Redmine-Issue-Assignee: jeremyevans0 X-Redmine-Sender: mame X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: =?us-ascii?Q?EJh2gqwnyqXtd++xo=2FinyA1V0bXouTB4FkWnzNiKb4803Sw+nhjIBlIioS3CVY?= =?us-ascii?Q?JGrFt2NoZ+RwIThj9WfX2wSI+mq6gS4KxIwDCtC?= =?us-ascii?Q?DhNqU3EgQtMd6trtdyXWQYcH7ApZRZwyu1KA5Ll?= =?us-ascii?Q?fE=2FrhC+tB+YhFjK2HUhZ7SMqeEji=2FpJVnzYcikV?= =?us-ascii?Q?Ds7GF4r2mSU27M=2FBwppeGrrher5OzH7PhqzI1Ju?= =?us-ascii?Q?Tt2OIG=2FRCSW42ABjk=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 96565 Subject: [ruby-core:96565] [Ruby master Bug#16465] False keyword warning against Struct#initialize X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #16465 has been updated by mame (Yusuke Endoh). https://github.com/ruby/ruby/pull/2795 ---------------------------------------- Bug #16465: False keyword warning against Struct#initialize https://bugs.ruby-lang.org/issues/16465#change-83503 * 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/