From: shugo@... Date: 2015-12-24T02:21:45+00:00 Subject: [ruby-core:72462] [Ruby trunk - Bug #11867] overriden constant instance variable mismatch 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/ Unsubscribe: