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 9482917C2839 for ; Mon, 18 Feb 2013 11:14:46 +0900 (JST) Received: from funfun.nagaokaut.ac.jp (smtp.nagaokaut.ac.jp [133.44.2.201]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id CBBB5EA6B93 for ; Mon, 18 Feb 2013 10:55:38 +0900 (JST) Received: from funfun.nagaokaut.ac.jp (localhost.nagaokaut.ac.jp [127.0.0.1]) by funfun.nagaokaut.ac.jp (Postfix) with ESMTP id A4BE397A82B for ; Mon, 18 Feb 2013 10:55:38 +0900 (JST) X-Virus-Scanned: amavisd-new at nagaokaut.ac.jp Received: from funfun.nagaokaut.ac.jp ([127.0.0.1]) by funfun.nagaokaut.ac.jp (funfun.nagaokaut.ac.jp [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EpeMOK_4NpSi for ; Mon, 18 Feb 2013 10:55:38 +0900 (JST) Received: from voscc.nagaokaut.ac.jp (voscc.nagaokaut.ac.jp [133.44.1.100]) by funfun.nagaokaut.ac.jp (Postfix) with ESMTP id 8420B97A838 for ; Mon, 18 Feb 2013 10:55:38 +0900 (JST) Received: from carbon.ruby-lang.org (carbon.ruby-lang.org [221.186.184.68]) by voscc.nagaokaut.ac.jp (Postfix) with ESMTP id 94F7C952408 for ; Mon, 18 Feb 2013 10:55:36 +0900 (JST) Received: from beryllium.ruby-lang.org (beryllium.ruby-lang.org [127.0.0.1]) by carbon.ruby-lang.org (Postfix) with ESMTP id F24033C21EB41; Mon, 18 Feb 2013 10:48:10 +0900 (JST) Received: from fluorine.ruby-lang.org (www.rubyist.net [210.251.121.216]) by carbon.ruby-lang.org (Postfix) with ESMTP id 43F853C21E30B for ; Mon, 18 Feb 2013 10:47:49 +0900 (JST) Received: from ruby-lang.org (localhost [127.0.0.1]) by fluorine.ruby-lang.org (Postfix) with ESMTP id 1F77E3E003 for ; Mon, 18 Feb 2013 10:47:49 +0900 (JST) Delivered-To: ruby-core@ruby-lang.org Date: Mon, 18 Feb 2013 10:47:58 +0900 Posted: Mon, 18 Feb 2013 10:47:48 +0900 From: "nobu (Nobuyoshi Nakada)" Reply-To: ruby-core@ruby-lang.org Subject: [ruby-core:52425] [ruby-trunk - Bug #7475] Unexpected behavior of Module#append_features on singleton class To: ruby-core@ruby-lang.org Message-Id: References: X-ML-Name: ruby-core X-Mail-Count: 52425 X-MLServer: fml [fml 4.0.3 release (20011202/4.0.3)]; post only (only members can post) X-ML-Info: If you have a question, send e-mail with the body "help" (without quotes) to the address ruby-core-ctl@ruby-lang.org; help= X-Mailer: Redmine X-Redmine-Issue-Author: ernie X-Redmine-Issue-Assignee: matz X-Auto-Response-Suppress: OOF X-Redmine-Issue-Id: 7475 X-Redmine-Mailinglistintegration-Message-Ids: 25474 X-Redmine-Project: ruby-trunk Auto-Submitted: auto-generated X-Redmine-Site: Ruby Issue Tracking System X-Redmine-Host: bugs.ruby-lang.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Precedence: bulk List-Id: ruby-core.ruby-lang.org List-Software: fml [fml 4.0.3 release (20011202/4.0.3)] List-Post: List-Owner: List-Help: List-Unsubscribe: Issue #7475 has been updated by nobu (Nobuyoshi Nakada). Description updated ---------------------------------------- Bug #7475: Unexpected behavior of Module#append_features on singleton class https://bugs.ruby-lang.org/issues/7475#change-36480 Author: ernie (Ernie Miller) Status: Open Priority: Normal Assignee: matz (Yukihiro Matsumoto) Category: Target version: next minor ruby -v: ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-darwin12.2.0] =begin A more involved explanation is available at (()) In short, the handling of class variables (and constants) when a module is extended vs included is not as expected. Example: module Foo @@foo = 'foo' end class Bar include Foo end class Baz extend Foo end Bar.class_variable_get :@@foo # => "foo" Baz.singleton_class.class_variable_get :@@foo # => NameError: uninitialized class variable @@foo in Class We would expect constant and class variable lookup on the singleton class to work, but it doesn't. Both Rubinius and JRuby seem to behave as expected in this case. Thanks! =end -- http://bugs.ruby-lang.org/