I opened an issue:
https://pharo.fogbugz.com/f/cases/12731/Traits-modifications-cause-a-DNU

I marked it as a show stopper because right now you cannot load a package with Traits in the image.

I am not sure about triggering the event for subclasses, but I can certainly understand that it can be useful for tools. However, the problem is that we are trying to figure out isPropagation after we trigger it, instead of doing it while triggering for a subclass. So, one possibility would be to distinguish between ClassModified and SuperclassModified. I tried to search in the code quickly but could not locate the exact place. I will try again later if nobody beats me to it.

Cheers,
Doru


On Sun, Jan 26, 2014 at 11:29 PM, Esteban Lorenzano <estebanlm@gmail.com> wrote:
can you propose a fix?

On 26 Jan 2014, at 22:56, Martin Dias <tinchodias@gmail.com> wrote:




On Sun, Jan 26, 2014 at 10:50 PM, Martin Dias <tinchodias@gmail.com> wrote:



On Sun, Jan 26, 2014 at 4:07 PM, Tudor Girba <tudor@tudorgirba.com> wrote:
I looked more into it, and here is a smaller example:
Gofer new�
smalltalkhubUser: 'Moose' project: 'MooseAlgos';
package: 'Moose-Algos-Graph';
load

This one does open the debugger, so the other emergency evaluator issue comes from somewhere else.

The problem seems to come from a Trait being defined in this package, and loading this trait triggers ClassModifiedClassDefinition which stumbles in�

ClassModifiedClassDefinition>>isPropagation�
"If there is not slot changes, I can assume that there is a propagation (the change is in one of the superclasses)"
self oldClassDefinition layout ifNil: [ ^ false ].
^ self newClassDefinition layout instanceVariables = self oldClassDefinition layout instanceVariables


Despite of the name of ClassModifiedClassDefinition, it is announced also when traits are modified. I don't know if Trait should implement #layout... but it is not. �

I reproduced using this:

Trait named: #DDDD.
Trait�
named: #DDDD�
uses: {TSortable}�
category: 'a'.

I guess that�ClassModifiedClassDefinition�is not only being announced when a class changed but also it is being announced when its superclass changed (in the case, "propagated"). So the purpose of #isPropagation is the check that. But I'm not sure this announcement should be done for the subclasses...



Yes, when a class is redefined, the change is announced for subclasses also. Maybe we shouldn't, no?

code to reproduce:


aClass := Object subclass: #A.
aClass subclass: #B.

anns := OrderedCollection new.
SystemAnnouncer uniqueInstance�
when: ClassModifiedClassDefinition
send: #add:
to: anns.

Object�
subclass: #A
instanceVariableNames: 'a'.

anns. --->
an OrderedCollection(a ClassModifiedClassDefinition a ClassModifiedClassDefinition)



Mart�n





--
www.tudorgirba.com

"Every thing has its own flow"