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.

P.S. If you think it will work, feel free to post it.


--
Best regards,
Igor Stasenko.