[squeak-dev] ClassTraitTest pollutes system

Alexander Lazarević laza at blobworks.com
Mon Oct 5 11:49:58 UTC 2009


Hi!

I think in a healthy squeak system

(ProtoObject allSubclasses reject: [:each | each isMeta or: [each
environment includes: each]]) size

should be zero. This is true for a fresh trunk image. If you evaluate
above expression after running ClassTraitTest the returned number is 9
and increases by 9 every time you run the test. As an effect of this
in a browser you can't switch to the class side of ProtoObject,
because this produces an exception. The exception gets raised because
some of ProtoObjects subclasses are not known in the environment
Smalltalk.

An example why this happens is here:

setUpTrivialRequiresFixture
	self c3: (self
				createClassNamed: #C3
				superclass: ProtoObject
				uses: { }).
	self c3 superclass: nil.
	self c3 compile: 'foo ^self bla' classified: #accessing

C3 is created as a subclass of ProtoObject, but then the superclass
pointer of C3 is twisted to nil . I haven't found a place where this
would be fixed by the system again. And when C3 is removed from the
system it is still in ProtoObjects subclasses.

The tests in ClassTraitTest return all green status and don't check if
the classes are still broken.

Should the test be removed or is there just something (I'm) missing?
Anyone got more infos on the whys and whats?

Alex



More information about the Squeak-dev mailing list