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-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY 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 082AF1F4B4 for ; Tue, 5 Jan 2021 23:05:20 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 8079F1209E7; Wed, 6 Jan 2021 08:04:29 +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 DD9861209B5 for ; Wed, 6 Jan 2021 08:04:26 +0900 (JST) Received: by filterdrecv-p3mdw1-7474cd8bfd-kfrsc with SMTP id filterdrecv-p3mdw1-7474cd8bfd-kfrsc-19-5FF4F0A9-3C 2021-01-05 23:05:13.364320587 +0000 UTC m=+2246585.637279378 Received: from herokuapp.com (unknown) by ismtpd0136p1mdw1.sendgrid.net (SG) with ESMTP id s_SIpsveQvu6-kEraxLZUQ for ; Tue, 05 Jan 2021 23:05:13.304 +0000 (UTC) Date: Tue, 05 Jan 2021 23:05:13 +0000 (UTC) From: hsbt@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 77848 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 17512 X-Redmine-Issue-Author: HParker X-Redmine-Issue-Assignee: marcandre X-Redmine-Sender: hsbt 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?9+ToIm+BmphpEzrVEr2fqVDpB0VofQNbgfqsVvtPdY0oF5sQt2HAbjkVYzj7dz?= =?us-ascii?Q?N64P=2Frst73x1ot15Z45ltI19zZ76Oa68+tk6TOq?= =?us-ascii?Q?Feq7G5qdPw5zShoYJLuSbD8APmO12yUPrGW=2FvwB?= =?us-ascii?Q?1gC64wh8oxQ3GtQxSt1bEp8UAyEVPYzIbb97NJ4?= =?us-ascii?Q?EzECp4Ply+5AtuRIeLqoMI7rIzVRjdse=2FRMpcS2?= =?us-ascii?Q?QCFwPz0linEqJVcXg=3D?= To: ruby-core@ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== X-ML-Name: ruby-core X-Mail-Count: 101941 Subject: [ruby-core:101941] [Ruby master Bug#17512] ostruct super regression 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 #17512 has been updated by hsbt (Hiroshi SHIBATA). Assignee set to marcandre (Marc-Andre Lafortune) Status changed from Open to Assigned ---------------------------------------- Bug #17512: ostruct super regression https://bugs.ruby-lang.org/issues/17512#change-89788 * Author: HParker (Adam Hess) * Status: Assigned * Priority: Normal * Assignee: marcandre (Marc-Andre Lafortune) * ruby -v: 3.0.0 * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN ---------------------------------------- In ruby 3.0, Calling super on ostruct always returns nil. This is a regression in ruby 3.0 introduced when fixing another issue. introduced by: - https://bugs.ruby-lang.org/issues/12136 - https://github.com/ruby/ruby/commit/e026e186f4a01aa3f6cd02ae6ef33f44f129361c This unintentionally changed `super` behavior in classes that inherit from OpenStruct. ```ruby require 'ostruct' class Foo < OpenStruct def foo super end end p Foo.new(foo: 123).foo ``` ``` Ruby 3.0: => nil Ruby 2.7: => 123 ``` Potential fix is to bring back some of the behavior reverted in issue #12136 to allow method missing to sometimes respond to methods with zero arguments. This is implemented in: https://github.com/ruby/ruby/pull/4028 and included as a patch attached to this issue. ---Files-------------------------------- 0001-Allow-ostruct-to-return-a-value-on-super.patch (1.7 KB) -- https://bugs.ruby-lang.org/