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=-3.7 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,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 6A1561F4C0 for ; Mon, 21 Oct 2019 08:14:30 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 79110120954; Mon, 21 Oct 2019 17:14:20 +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 6A710120902 for ; Mon, 21 Oct 2019 17:14:18 +0900 (JST) Received: by filter0084p3iad2.sendgrid.net with SMTP id filter0084p3iad2-13321-5DAD68DB-19 2019-10-21 08:14:19.153487135 +0000 UTC m=+294218.674226291 Received: from herokuapp.com (unknown [54.159.77.90]) by ismtpd0030p1mdw1.sendgrid.net (SG) with ESMTP id RU_2OENeSnujkCfRtF2xhA for ; Mon, 21 Oct 2019 08:14:18.993 +0000 (UTC) Date: Mon, 21 Oct 2019 08:14:19 +0000 (UTC) From: ko1@atdot.net Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 71042 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 15574 X-Redmine-Issue-Author: ko1 X-Redmine-Issue-Assignee: matz X-Redmine-Sender: ko1 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?fVTMYOBjtdvXNcWwrscBhLsHItUXVK5L4mtnq0mdcRdekdDWQ1u9NgZrMXNw8b?= =?us-ascii?Q?ITVwzMvXxwo2SFfaXfMc8GLeziPDLX5K+n4AW4l?= =?us-ascii?Q?gPnWb0pzZN9MzQ6L6hgzxVIlZiY4x802yvxf1kt?= =?us-ascii?Q?mubczrJKASg7lmYVspDUMEpJbf5DyGI7RCQgvDh?= =?us-ascii?Q?Lz17pHSca2t83?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 95451 Subject: [ruby-core:95451] [Ruby master Feature#15574] Prohibit to pass a block on super() implicitly 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 #15574 has been updated by ko1 (Koichi Sasada). Status changed from Open to Rejected it seems difficult to apply this proposal because of compatibility (and productivity). rejected. ---------------------------------------- Feature #15574: Prohibit to pass a block on super() implicitly https://bugs.ruby-lang.org/issues/15574#change-82201 * Author: ko1 (Koichi Sasada) * Status: Rejected * Priority: Normal * Assignee: matz (Yukihiro Matsumoto) * Target version: ---------------------------------------- As described in [Feature #15554], `super()` (not `super`) pass the given block. ``` class C def foo p block_given? end end class C1 < C def foo super #=> true super() #=> true end end C1.new.foo{} ``` `super` (without parameters) passes all passed parameters so it is no surprise to pass given block. However, `super()` (with parameters. In this case, it passes 0 parameters) also pass given block implicitly. I'm not sure who use this behavior, but I think it is simple to prohibit such implicit block passing. -- https://bugs.ruby-lang.org/