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 0E26B19E005C for ; Fri, 18 Dec 2015 12:42:57 +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 1BC9CB5D871 for ; Fri, 18 Dec 2015 13:15:04 +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 7821E18CC7E8 for ; Fri, 18 Dec 2015 13:15:04 +0900 (JST) Received: from [221.186.184.76] (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 2729A120795; Fri, 18 Dec 2015 13:14:00 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org Received: from mail-io0-f174.google.com (mail-io0-f174.google.com [209.85.223.174]) by neon.ruby-lang.org (Postfix) with ESMTPS id E45B1120749 for ; Fri, 18 Dec 2015 13:13:25 +0900 (JST) Received: by mail-io0-f174.google.com with SMTP id e126so77745594ioa.1 for ; Thu, 17 Dec 2015 20:13:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:message-id:subject:mime-version:content-type; bh=NZ8SzKeofpdrO6aiC/Kbcfb9cbCZey4Ur355xfgZDqw=; b=pwLLEKpSLEzBPSnHh7FGrAoBOASIsf6+W5UrX2fe7YL6f6JItaEigQ0m3i49cz1/y/ seWjnlqDoRTZ/HXJUOYt5skjhV9LNtyce2pt++02pVdM2TnGNs5H/OEhOhGqEpfJ/bmr Yzkkv/Yuc/pBIRr5dw9BEvqrRkit8kOJraPZGyF4eYpS8HXiomN5nL+H8gaswirwnU77 NNsbFSrPDWm30kvMI8yoFLdHB1JxXf5t5m9S1ZuyTRzBL3cbDa7YQ6muB9wbztJaspgv 0iwv4tBJz7sPX1FOGCSvhckZ6DdOkXng2LyW7xHF68coc6My1bOFJojcaYeUOu1Qjol6 yqXQ== X-Received: by 10.107.25.199 with SMTP id 190mr2184727ioz.37.1450412004762; Thu, 17 Dec 2015 20:13:24 -0800 (PST) Received: from Josephe-Jones (75-166-130-47.hlrn.qwest.net. [75.166.130.47]) by smtp.gmail.com with ESMTPSA id e5sm5808129ioj.40.2015.12.17.20.13.23 for (version=TLSv1/SSLv3 cipher=OTHER); Thu, 17 Dec 2015 20:13:24 -0800 (PST) Date: Thu, 17 Dec 2015 21:13:23 -0700 From: Joseph Jones To: Ruby developers Cc: Message-ID: X-Mailer: BoxerFree 6.0.4 (321) X-Boxer-Generated: true X-Boxer-IsLike: true MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="567387e3_53584bcb_16c" X-ML-Name: ruby-core X-Mail-Count: 72343 Subject: [ruby-core:72343] [Ruby trunk - Bug #11779] [Open] Mudule#using does not make sense as a method 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: , Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" --567387e3_53584bcb_16c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Joseph Jones liked your message with Boxer. On December 6, 2015 at 14:40:= 14 MST, alxtskrnk=40gmail.com wrote:Issue =2311779 has been reported by b= ug hit.----------------------------------------Bug =2311779: Mudule=23usi= ng does not make sense as a methodhttps://bugs.ruby-lang.org/issues/11779= * Author: bug hit* Status: Open* Priority: Normal* Assignee: * ruby -v: 2= .2.3* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN---------------= -------------------------1. it can't be called from another method2. the = receiver must be self3. since refinements are lexically scoped the self r= eceiver must match the currently open class=233 is particularly curious=60= =60=60rubymodule Refinement refine String do def refined=3F true end ende= ndmodule =46oo def self.refined=3F ''.refined=3F rescue false endendmodul= e Bar def self.refined=3F ''.refined=3F rescue false end =46oo.module=5Fe= val do using Refinement endendp =46oo.refined=3F =23false=60=60=60The mod= ule=5Feval =60=23using=60 call does not raise (it's not from a method and= the receiver is self), but evidently because currently open class does n= ot match self, it does not do anything. So it should at least raise.So =60= =23using=60, though a method, does not function as a method, which is mis= leading.-- https://bugs.ruby-lang.org/ --567387e3_53584bcb_16c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Joseph Jones liked your message with Boxer.


= On December 6, 2015 at 14:40:14 MST, alxtskrnk=40gmail.com wrote:
Issue =2311779 has been repor= ted by bug hit.

----------------------------------------
= Bug =2311779: Mudule=23using does not make sense as a method
https:/= /bugs.ruby-lang.org/issues/11779

* Author: bug hit
* Stat= us: Open
* Priority: Normal
* Assignee:
* ruby -v: 2.2.3<= br />* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
--------= --------------------------------
1. it can't be called from another = method
2. the receiver must be self
3. since refinements are le= xically scoped the self receiver must match the currently open class

=233 is particularly curious

=60=60=60ruby
module = Refinement
refine String do
def refined=3F
tru= e
end
end
end

module =46oo
def sel= f.refined=3F
''.refined=3F rescue false
end
end


module Bar
def self.refined=3F
''.refined=3F= rescue false
end
=46oo.module=5Feval do
using Ref= inement

end
end

p =46oo.refined=3F =23false<= br />=60=60=60

The module=5Feval =60=23using=60 call does not = raise (it's not from a method and the receiver is self), but evidently be= cause currently open class does not match self, it does not do anything. = So it should at least raise.

So =60=23using=60, though a metho= d, does not function as a method, which is misleading.


<= br />--
https://bugs.ruby-lang.org/
<= /body> --567387e3_53584bcb_16c--