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 (smtp.nagaokaut.ac.jp [133.44.2.24]) by blade.nagaokaut.ac.jp (Postfix) with ESMTP id CFFFE19E0035 for ; Wed, 30 Dec 2015 04:01:47 +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 6F89CB5D874 for ; Wed, 30 Dec 2015 04:34:27 +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 6127518CC7B8 for ; Wed, 30 Dec 2015 04:34:27 +0900 (JST) Received: from [221.186.184.76] (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 157B81205BC; Wed, 30 Dec 2015 04:34:25 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org Received: from o10.shared.sendgrid.net (o10.shared.sendgrid.net [173.193.132.135]) by neon.ruby-lang.org (Postfix) with ESMTPS id 0D0201205A6 for ; Wed, 30 Dec 2015 04:34:20 +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=J1FJYenxcDLdtZqT9X8mYSLnIRk=; b=JrAoV565yOfkKHuZ1Y 06hBk4tI4FnlnJIHfQc9/vWXhD26W5hN1x4NMq+u92ch3sjRY25XpF7R2dR+Qq2i 66SquHVKngRwTiGTFD9t+yaiffYzOejeXyV4CG59EloTwgCALx/oPvLgxWHKBGIj SlVwK8MXYletHQjrB473x/12A= Received: by filter0601p1mdw1.sendgrid.net with SMTP id filter0601p1mdw1.8732.5682E0224F 2015-12-29 19:33:54.718740218 +0000 UTC Received: from herokuapp.com (ec2-54-234-178-158.compute-1.amazonaws.com [54.234.178.158]) by ismtpd0002p1iad1.sendgrid.net (SG) with ESMTP id i7whiBFVRveW9Ak_6SoarA for ; Tue, 29 Dec 2015 19:33:54.610 +0000 (UTC) Date: Tue, 29 Dec 2015 19:33:54 +0000 From: sephvelut@gmail.com To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 47199 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 11867 X-Redmine-Issue-Author: dingoegret X-Redmine-Sender: dingoegret 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/Ymy4QrNMhiuLXJG8OTL2vJD1yS4vRIMSnbBXen/noL9L6PvgetxMQ5Bp/0b2ak gNOP5FYTGKnZp+hMAAbzkGUGAd51Az908IbMBSZRHlEc5ABM+mi80XxDImz6HhDdPPpnk/oy1E8kd1 VI2nKpzGw6xmAUt65rKNOUumjdskIQjJvoIL/axQmZ2GFiy97CkDD/9XdQ== X-ML-Name: ruby-core X-Mail-Count: 72600 Subject: [ruby-core:72600] [Ruby trunk - Bug #11867] overriden constant instance variable mismatch 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 #11867 has been updated by dingo egret. Nobuyoshi Nakada wrote: > Exactly. > > What do you expect instead? I expected the latest constant to set its @b property. If not Class A, at the very least I expected Struct :a to get set. Is this not the intuitive thing to expect? People send arguments based on param ordering in constant definition. This is totally bypassing that expectation. ---------------------------------------- Bug #11867: overriden constant instance variable mismatch https://bugs.ruby-lang.org/issues/11867#change-55849 * Author: dingo egret * Status: Feedback * Priority: Normal * Assignee: * ruby -v: ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14] * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN ---------------------------------------- ~~~ruby A = Struct.new(:a) A.new(1) # class A def initialize(b) @b = b end end A.new(1) # ~~~ Is this expected? -- https://bugs.ruby-lang.org/