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 2CFCF19E002E for ; Thu, 24 Dec 2015 10:49:32 +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 59E4FB5D86C for ; Thu, 24 Dec 2015 11:21:55 +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 B478118CC7B1 for ; Thu, 24 Dec 2015 11:21:55 +0900 (JST) Received: from [221.186.184.76] (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 1764D1204FB; Thu, 24 Dec 2015 11:21:54 +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 1419E1204DC for ; Thu, 24 Dec 2015 11:21:49 +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=KnwdBC6yf3duyoEES4ts2YyHQNE=; b=RpZg0hJO6VL0PfZoQq OTCiWYlPyzyJdEqzCs5bRbiX2TcKcVKiygmegnEKuz9R86SJuTWuG0pD3dfmG1B3 5BBIybqAieE/ZZGvFKCgQPFuiexD3ro1Xrtsvwi3ebZmqwhr+EmN1uT6olF1emT9 6ZfMJVakT3HnLCUWN5ubmn98E= Received: by filter0467p1mdw1.sendgrid.net with SMTP id filter0467p1mdw1.22565.567B56B939 2015-12-24 02:21:45.800889008 +0000 UTC Received: from herokuapp.com (ec2-50-17-34-135.compute-1.amazonaws.com [50.17.34.135]) by ismtpd0003p1iad1.sendgrid.net (SG) with ESMTP id ysXoQd2rTxiZ4dNCVRfpiA for ; Thu, 24 Dec 2015 02:21:45.565 +0000 (UTC) Date: Thu, 24 Dec 2015 02:21:45 +0000 From: shugo@ruby-lang.org To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 47062 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 11867 X-Redmine-Issue-Author: dingoegret X-Redmine-Sender: shugo 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/Ymy4QrNMhiuLXJG8OTL2vJD1yS7fxzvZdTjHDcPItnuiLTs0/DiCiWKNw6YQdV FUnD3zKSBUCrUGfBOxUGbdAhHqRhv09/PNyoBbtSph6xAJ2jSje5VqLrlSLDCBsM1oWWxzTqdlBlt/ mL9yNKxkwfClxEy9oBFZPNSpnbLtYmJerAxL3FJwcdWVWxgt1vsJpewb0g== X-SendGrid-Contentd-ID: {"test_id":"1450923706"} X-ML-Name: ruby-core X-Mail-Count: 72462 Subject: [ruby-core:72462] [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 Shugo Maeda. dingo egret wrote: > ~~~ruby > class A > def initialize(b) > @b = b > end > end You should call super if you want to set the member `a`. ~~~ruby class A def initialize(b) super(b) @b = b end end ~~~ ---------------------------------------- Bug #11867: overriden constant instance variable mismatch https://bugs.ruby-lang.org/issues/11867#change-55753 * 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/