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 24E9C19C01E9 for ; Wed, 18 Nov 2015 07:58:10 +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 B6B1EB5D8F8 for ; Wed, 18 Nov 2015 08:28:44 +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 E340918CC7AF for ; Wed, 18 Nov 2015 08:28:44 +0900 (JST) Received: from [221.186.184.76] (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 6CB52120485; Wed, 18 Nov 2015 08:28:44 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org Received: from o2.heroku.sendgrid.net (o2.heroku.sendgrid.net [67.228.50.55]) by neon.ruby-lang.org (Postfix) with ESMTPS id 05F09120457 for ; Wed, 18 Nov 2015 08:28:40 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.me; h=from:to:references:subject:mime-version:content-type:content-transfer-encoding:list-id; s=smtpapi; bh=LN31rie3jG6qYhDtcDC6N80cxIg=; b=W3h1ZPdMCZn4ZC/5Z6 zUwLhxE9Au/4S9CkdnBSVOE2NnmTlEh4McQ5wBXKvtNx2M10dJvSHA5d7cmq7eMA xESKjZMd2wgevSdn1FeTFlB8CcVyMoNP8pMlVn5vV1COzyblYCzMx+zNEOJjGNxi bE+ge+lZw8QHUAmf0ZEhFxvzU= Received: by filter0642p1mdw1.sendgrid.net with SMTP id filter0642p1mdw1.2514.564BB82425 2015-11-17 23:28:36.309196185 +0000 UTC Received: from herokuapp.com (ec2-54-144-225-166.compute-1.amazonaws.com [54.144.225.166]) by ismtpd0006p1iad1.sendgrid.net (SG) with ESMTP id AkKQevIESBKFLOXg_OL13A for ; Tue, 17 Nov 2015 23:28:36.206 +0000 (UTC) Date: Tue, 17 Nov 2015 23:28:36 +0000 From: mike@oobak.org To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Redmine-MailingListIntegration-Message-Ids: 46194 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 11705 X-Redmine-Issue-Author: mwpastore X-Redmine-Sender: mwpastore 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/Ymy4QrNMhiuLXJG8OTL2vJD1yS5LMypWrJQ+yOHNw28GMqtTIoow2fn8GT1Grs CV4iAkjgyPb5jUMHW1AD51oTzbd0BsuIzOVB6UAAqjpy3ynlxdXiJTIVS34JHVvx+qEsjvEVi+d2vv MJ/xDRh7IhObg5Azttzz8bfjYuGvfMZN0dDa X-ML-Name: ruby-core X-Mail-Count: 71532 Subject: [ruby-core:71532] [Ruby trunk - Bug #11705] [Open] Namespace resolution in nested modules with short syntax 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" Issue #11705 has been reported by Mike Pastore. ---------------------------------------- Bug #11705: Namespace resolution in nested modules with short syntax https://bugs.ruby-lang.org/issues/11705 * Author: Mike Pastore * Status: Open * Priority: Normal * Assignee: * ruby -v: * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN ---------------------------------------- Given the following definition: ~~~ module Foo class Qux def self.hello 'Hello, world!' end end end ~~~ Namespace resolution at a later time works differently when you have nested modules, e.g. ~~~ module Foo module Bar # Can't find Foo::Bar::Qux, so "goes up" to find Foo::Qux. p Qux.hello # < "Hello, world!" end end ~~~ vs. the short syntax, e.g. ~~~ module Foo::Bar # Can't find Foo::Bar::Qux, but doesn't "go up" to find Foo::Qux. p Qux.hello # < in `': uninitialized constant Foo::Bar::Qux (NameError) end ~~~ Is this intentional and/or expected? -- https://bugs.ruby-lang.org/