From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-3.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,SPF_PASS,T_DKIM_INVALID,T_RP_MATCHES_RCVD shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id 8BF1D20401 for ; Fri, 16 Jun 2017 02:28:13 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id A817F1207CA; Fri, 16 Jun 2017 11:28:10 +0900 (JST) Received: from o1678948x4.outbound-mail.sendgrid.net (o1678948x4.outbound-mail.sendgrid.net [167.89.48.4]) by neon.ruby-lang.org (Postfix) with ESMTPS id E6F00120788 for ; Fri, 16 Jun 2017 11:28:08 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=sendgrid.me; h=from:to:references:subject:mime-version:content-type:content-transfer-encoding:list-id; s=smtpapi; bh=ozNULWWzxgXIvETN9QfyYS32Zsg=; b=ZgluC0zYQrWceqOAII QTnAz5xywQQUnfafXgBm7qxZDs1NXESbp3Zn2ytJ2WFNBEvfXFoyYxD1/lQk8fcD YFTdftuYN3/T0W2T3PaxvFJorOcIrDo4ajWiBzFhKeoRqax3JtEkJRgtnbZEsnax DpUn2FY+FElKhwIxp7g8/Cy3M= Received: by filter0474p1mdw1.sendgrid.net with SMTP id filter0474p1mdw1-5321-59434233-38 2017-06-16 02:28:03.606609296 +0000 UTC Received: from herokuapp.com (ec2-54-145-124-9.compute-1.amazonaws.com [54.145.124.9]) by ismtpd0001p1iad1.sendgrid.net (SG) with ESMTP id OCwjIJ9gRgqPaA-oLBxVUA for ; Fri, 16 Jun 2017 02:28:03.699 +0000 (UTC) Date: Fri, 16 Jun 2017 02:28:03 +0000 From: nobu@ruby-lang.org To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 56723 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 13446 X-Redmine-Issue-Author: mtsmfm X-Redmine-Issue-Assignee: nobu X-Redmine-Sender: nobu 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: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS6VWtWSLq64Qh7rkcIi1rF2MKholLtOdWWv3u 90dQ8J/PicxT/cSw9EXZ2pgPyn9bM27I4TKlmMBy5a6TZOYohWFm2Pv23ASMXwiohKkf6TK9p/XvTl 2xMXVAWXcFFGtnxUyfYIXPbWlmFDfQ2dWpi0f5CUC/QsWWMN2VlwVqUZyA== X-ML-Name: ruby-core X-Mail-Count: 81696 Subject: [ruby-core:81696] [Ruby trunk Bug#13446][Assigned] refinements with prepend for module has strange behavior 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 #13446 has been updated by nobu (Nobuyoshi Nakada). Description updated Status changed from Open to Assigned Assignee set to nobu (Nobuyoshi Nakada) ---------------------------------------- Bug #13446: refinements with prepend for module has strange behavior https://bugs.ruby-lang.org/issues/13446#change-65384 * Author: mtsmfm (Fumiaki Matsushima) * Status: Assigned * Priority: Normal * Assignee: nobu (Nobuyoshi Nakada) * Target version: * ruby -v: ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux] * Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN ---------------------------------------- ~~~ruby using Module.new { refine Enumerable do alias :orig_sum :sum end } module Enumerable def sum(*args) orig_sum(*args) end end class GenericEnumerable include Enumerable def each end end # GenericEnumerable.new.sum # if we uncomment this line, `GenericEnumerable#sum` will work Enumerable.prepend(Module.new) # if we comment out this line, `GenericEnumerable#sum` will work p GenericEnumerable.new.sum # undefined method `orig_sum' for # (NoMethodError) ~~~ Is this intentional? -- https://bugs.ruby-lang.org/