overriden constant instance variable mismatch
A = Struct.new(:a) A.new(1) #<struct A a=1> class A def initialize(b) @b = b end end A.new(1) #<struct A a=nil>
Is this expected?
Updated by dingoegret (dingo egret) almost 4 years ago
Nobuyoshi Nakada wrote:
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.