On 17 Jan 2014, at 11:13, Igor Stasenko <siguctua@gmail.com> wrote:
On 17 January 2014 10:09, Camille Teruel <camille.teruel@gmail.com> wrote:
On 16 janv. 2014, at 16:58, Marcus Denker <marcus.denker@inria.fr> wrote:
Hello,
I was looking into that, the first (maybe only) reason is that the new class builder can not make anonymous subclasses of classes with ByteLayout
Is that really a bug? Should it really be possible to subclass a class that has a byte layout with a class that has a fixed layout?
i don't know and i don't care. Why i should care about such details in NB while all i want is to create simple anonymous subclass?
Because: AnonymousClassInstaller make: [ :builder | builder superclass: NBExternalTypeValue ] raises IncompatibleLayout but: AnonymousClassInstaller make: [ :builder | builder superclass: NBExternalTypeValue; layoutClass: ByteLayout ] doesn't. A simple fix is to take the same layout class than the superclass by default instead of FixedLayout, isn't it? For example with lazy initialization:
SlotClassBuilder>>#layoutClass ^ layoutClass ifNil: [ layoutClass := superclass layout class ]
i don't understand what is difference between 'fixed' and 'same as superclass' layout, and i am not sure i want to understand it. I want to be freed from knowing such details when doing something as simple as creating anonymous subclass.
This is a bug⦠But the fun thing is: I always explain to people that adding a second better subsystem but then not using it everywhere is not good. And we found another case! A bug in the new class builder that we would have found 5 months ago had we used the new one and not the old one in this case. Marcus