On 16 janv. 2014, at 16:58, Marcus Denker <[email protected]> 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?

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 ]


> 
> https://pharo.fogbugz.com/f/cases/12488/Can-not-create-newAnonymousSubclass-of-ByteLayout-classes
> 
> On 16 Jan 2014, at 16:55, Torsten Bergmann <[email protected]> wrote:
> 
>> When loading PunQLite [1] in recent Pharo3.0 Latest update: #30700
>> I get an exception (IncompatibleLayoutConflict).
>> 
>> It all boils down to the single expression:
>> 
>>  (NBExternalTypeValue ofType: 'NBInt64')
>> 
>> from an initialize method which raises this. When I try in Pharo3.0 Latest 
>> update: #30579 it works.
>> 
>> How can this be fixed? Is there something missing from the latest NB 
>> integration?
>> 
>> Thx
>> T.
>> 
>> 
>> [1] http://smalltalkhub.com/#!/~MasashiUmezawa/PunQLite
>> 
> 
> 

Reply via email to