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 4CFF01F463 for ; Sun, 29 Dec 2019 07:50:03 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 0E88A120B0F; Sun, 29 Dec 2019 16:49:49 +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 92F47120936 for ; Sun, 29 Dec 2019 16:49:47 +0900 (JST) Received: by filterdrecv-p3mdw1-56c97568b5-qqd9g with SMTP id filterdrecv-p3mdw1-56c97568b5-qqd9g-18-5E085AA0-11 2019-12-29 07:49:52.285305243 +0000 UTC m=+1062402.935857085 Received: from herokuapp.com (unknown [54.145.162.235]) by ismtpd0095p1iad2.sendgrid.net (SG) with ESMTP id xGZbb2eWQvK6IkH9biN97Q for ; Sun, 29 Dec 2019 07:49:52.214 +0000 (UTC) Date: Sun, 29 Dec 2019 07:49:52 +0000 (UTC) From: mame@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 72222 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=2FinyA1V0bXouTB4FkWnzNiKb48nQsEjFItYXWxmaw=2FeKL?= =?us-ascii?Q?u=2FGGMXfHS2y3vfnZApeGSkRVCAubdyQ6Gqb=2Fk8M?= =?us-ascii?Q?cVaW5oUo=2FDC10flFViLcxN0Ajzk49a38suCL+IB?= =?us-ascii?Q?iGALGXF8991XgFHHSBQtBfZ3=2FALN9HbY6l95ixy?= =?us-ascii?Q?surw6OocZKSPMAMU+=2FBeMyINBT4ARaIcoU3hbwC?= =?us-ascii?Q?3DTsIMAIr0piXS2vM=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 96563 Subject: [ruby-core:96563] [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 reported by mame (Yusuke Endoh). ---------------------------------------- Bug #16465: False keyword warning against Struct#initialize https://bugs.ruby-lang.org/issues/16465 * 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/