From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: poffice@blade.nagaokaut.ac.jp Delivered-To: poffice@blade.nagaokaut.ac.jp Received: from kankan.nagaokaut.ac.jp (kankan.nagaokaut.ac.jp [133.44.2.24]) by blade.nagaokaut.ac.jp (Postfix) with ESMTP id 3C4A617DEA0B for ; Tue, 18 Apr 2017 09:37:52 +0900 (JST) Received: from voscc.nagaokaut.ac.jp (voscc.nagaokaut.ac.jp [133.44.1.100]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id D2724B5D966 for ; Tue, 18 Apr 2017 10:17:40 +0900 (JST) Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by voscc.nagaokaut.ac.jp (Postfix) with ESMTP id 1AAA618CC81A for ; Tue, 18 Apr 2017 10:17:41 +0900 (JST) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id DE5491207BA; Tue, 18 Apr 2017 10:17:39 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org Received: from o1678916x28.outbound-mail.sendgrid.net (o1678916x28.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id 586E41207AA for ; Tue, 18 Apr 2017 10:17:36 +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=HoauCFLPNLS6O4+kiuCKqIoqDIE=; b=v7VAloxQNZyYhcJAcL 5PrvjE9VEUvXJgqMVWZtzLARqel8jD1YmUiDnkQ3rrLCEDgNvt25yjHxoJSFwHcV eWe4bFoSZzPytozMrn/4kDR/6p8B+Uw0vQ4YhJQ0SxAswJCqmrFx5LCE3PqXhiZF Ex8uKOs0u6ciydTW80pw21Td0= Received: by filter0443p1mdw1.sendgrid.net with SMTP id filter0443p1mdw1-25020-58F5692B-3D 2017-04-18 01:17:31.72419671 +0000 UTC Received: from herokuapp.com (ec2-54-163-67-45.compute-1.amazonaws.com [54.163.67.45]) by ismtpd0001p1iad1.sendgrid.net (SG) with ESMTP id vMquVLxcQ36h3XgW0Pr41A for ; Tue, 18 Apr 2017 01:17:31.691 +0000 (UTC) Date: Tue, 18 Apr 2017 01:17:31 +0000 From: mtsmfm@gmail.com To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 55742 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 13446 X-Redmine-Issue-Author: mtsmfm X-Redmine-Sender: mtsmfm 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/Ymy4QrNMhiuLXJG8OTL2vJD1yS6KK18hwTtOdL9gmKjc6BTuVN9BF43P4bB6D7 oaCdkldisjM1WNNTjG8BI6US624Vf7Y5zDLcWhi1J1DMVIfmfGwhfehd+qZZifTGoPrIxceYM5xuaE ItadIXuMcWK+xmFcTuKOS2GiNKJy0xRyLqzPHueKWuGEx0+hnORjSunMHA== X-ML-Name: ruby-core X-Mail-Count: 80748 Subject: [ruby-core:80748] [Ruby trunk Bug#13446] 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 reported by mtsmfm (Fumiaki Matsushima). ---------------------------------------- Bug #13446: refinements with prepend for module has strange behavior https://bugs.ruby-lang.org/issues/13446 * Author: mtsmfm (Fumiaki Matsushima) * Status: Open * Priority: Normal * Assignee: * 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 ---------------------------------------- ~~~ 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/