[ENH] protecting against nil superclasses

Lex Spoon lex at cc.gatech.edu
Tue Oct 9 05:18:20 UTC 2001


First, the problem: a person, typically a newbie, loads classes in the
wrong order and thus ends up with a class that has no superclass.  If a
message from Object is sent to this class, the VM will try to send
#doesNotUnderstand:, which is also a message from Object, and then
finally the VM will abort.

The attached changeset remedies this by making people take an extra step
if they really want a nil subclass.  If they don't take that step, then
they end up with a subclass of ProtoObject and a warning sent to the
Transcript.  The ideal would be to create the superclass that was
requested, so that if the superclass is later reloaded, everything will
be fine.  But this should do for now.

Also, it's quite possible that whatever modules system we end up with
will fix this problem, as well.  Ah well, this is extremely simple, and
it's here now.  What do you guys think?

-Lex
-------------- next part --------------
A non-text attachment was scrubbed...
Name: /home/lex/squeak/nilSuperclass.3.cs
Type: application/octet-stream
Size: 3912 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20011009/900e2382/nilSuperclass.3.obj


More information about the Squeak-dev mailing list