ccrma / chuck

ChucK Music Programming Language
http://chuck.stanford.edu/
GNU General Public License v2.0
799 stars 127 forks source link

Object member variables of chugin types are not instantiated in constructor #449

Open AndrewAday opened 1 month ago

AndrewAday commented 1 month ago

chugin.cpp

    QUERY->begin_class(QUERY, "Foo", "Object");
    QUERY->add_ctor(QUERY, foo_ctor);
    QUERY->add_mvar(QUERY, "int", "val", false);
    QUERY->end_class(QUERY);

    QUERY->begin_class(QUERY, "Bar", "Object");
    QUERY->add_ctor(QUERY, bar_ctor);
    QUERY->add_mvar(QUERY, "Foo", "foo", false);
    QUERY->end_class(QUERY);

test.ck

Bar b;  // bar_ctor is called, but never foo_ctor
<<< b.foo.val >>>;  // throws nullptr error. b.foo == NULL, foo was never instantiated
AndrewAday commented 1 month ago

seems related to #447