instantiations / tonel-vast

Tonel file format writer and reader implementation for VA Smalltalk
MIT License
9 stars 3 forks source link

Improve the behavior of `#autogenerateInstanceInitializers` to avoid multiple initialization #131

Closed eMaringolo closed 1 year ago

eMaringolo commented 1 year ago

Setting #autogenerateInstanceInitializers: true will cause the creation of class-side #new method that will send #initialize to the newly created instance.

But if the hierarchy is large, this can cause the #new method to be defined in all the hierarchy, causing #initialize to be sent multiple times to the instance. This should be improved and only create the #new initializer method if the superclass doesn't define it already.

Also, it would be useful to avoid the creation of new class editions if the changes between a class in the Tonel source definition and the base edition in the ENVY library only differ in such method (and nothing else). This could be an option in the loader.

eMaringolo commented 1 year ago

I found that detectAllRootSuperclassesWithinApp is not working as expected.

eMaringolo commented 1 year ago

Fixed by ddc7d9d9c8483d1dae18504a433cc843672f3f17