[BUG] Filein cs with a non-existent class

RossBoylan at stanfordalumni.org RossBoylan at stanfordalumni.org
Sun Jun 16 19:30:05 UTC 2002


Scenario: I have a class defined in my image.  I filein a cs that
redefines the class
as a subclass of a class that is not in my image.  I get the error shown
below.

It might be a little strong to call this a bug, but the behavior is
certainly cryptic.  Also, I don't know if I can recover the previous
state of affairs.

I got in this state because of the following method definiton:
UndefinedObject>>subclass: nameOfClass  
	instanceVariableNames: instVarNames
	classVariableNames: classVarNames
	poolDictionaries: poolDictnames
	category: category
	"Calling this method is now considered an accident.  If you really want
to create a class with a nil superclass, then create the class and then
set the superclass using #superclass:"
	Transcript show: ('Attempt to create ', nameOfClass, ' as a subclass of
nil.  Possibly a class is being loaded before its superclass.'); cr.
	^ProtoObject
		subclass: nameOfClass
		instanceVariableNames: instVarNames
		classVariableNames: classVarNames
		poolDictionaries: poolDictnames
		category: category

Hmm, I didn't have a trascript open, which would have given me some
clue.  Also, I'm not
sure why the presence of an unknown symbol (the receiver of the
subclass:... message) 
did not generate more of an error.

16 June 2002 12:17:32 pm

VM: unix - Squeak3.2gamma of 22 January 2002 [latest update: #4653]
Image: Squeak3.2gamma [latest update: #4843]

ModeButtonMorph(ProtoObject)>>doesNotUnderstand:
	Receiver: <<error during printing>>
	Arguments and temporary variables: 
		aMessage: 	a Message with selector: #instVarAt:put: and arguments: #(1
#off)
	Receiver's instance variables: 
<<error during printing>>

ModeButtonMorph
class(ClassDescription)>>newInstanceFrom:variable:size:map:
	Receiver: ModeButtonMorph
	Arguments and temporary variables: 
<<error during printing>
	Receiver's instance variables: 
		superclass: 	ProtoObject
		methodDict: 	a MethodDictionary(#DoIt->a CompiledMethod (826)
#actWhen:->a Compi...etc...
		format: 	140
		instanceVariables: 	#('state' 'target' 'actionSelector' 'arguments'
'actWhen')
		organization: 	('initialization' adaptToWorld: initialize)
('copying' updateRefe...etc...
		subclasses: 	#(TwoModeButtonMorph)
		name: 	#ModeButtonMorph
		classPool: 	a Dictionary(#AuthorModeOwner->nil )
		sharedPools: 	nil
		environment: 	a SystemDictionary(lots of globals)
		category: 	nil

ModeButtonMorph class(ClassDescription)>>updateInstances:from:isMeta:
	Receiver: ModeButtonMorph
	Arguments and temporary variables: 
		oldInstances: 	#(ModeButton(Task[Sample Task] 3433) ModeButton(a
TaskManager 806...etc...
		oldClass: 	ModeButtonMorph
		isMeta: 	false
		map: 	#(8 9 10 11 12)
		variable: 	false
		instSize: 	5
		newInstances: 	#(nil nil nil nil nil nil)
		i: 	1
		iLimiT: 	6
	Receiver's instance variables: 
		superclass: 	ProtoObject
		methodDict: 	a MethodDictionary(#DoIt->a CompiledMethod (826)
#actWhen:->a Compi...etc...
		format: 	140
		instanceVariables: 	#('state' 'target' 'actionSelector' 'arguments'
'actWhen')
		organization: 	('initialization' adaptToWorld: initialize)
('copying' updateRefe...etc...
		subclasses: 	#(TwoModeButtonMorph)
		name: 	#ModeButtonMorph
		classPool: 	a Dictionary(#AuthorModeOwner->nil )
		sharedPools: 	nil
		environment: 	a SystemDictionary(lots of globals)
		category: 	nil

ModeButtonMorph class(ClassDescription)>>updateInstancesFrom:
	Receiver: ModeButtonMorph
	Arguments and temporary variables: 
		oldClass: 	ModeButtonMorph
		oldInstances: 	#(ModeButton(Task[Sample Task] 3433) ModeButton(a
TaskManager 806...etc...
		seg: 	nil
	Receiver's instance variables: 
		superclass: 	ProtoObject
		methodDict: 	a MethodDictionary(#DoIt->a CompiledMethod (826)
#actWhen:->a Compi...etc...
		format: 	140
		instanceVariables: 	#('state' 'target' 'actionSelector' 'arguments'
'actWhen')
		organization: 	('initialization' adaptToWorld: initialize)
('copying' updateRefe...etc...
		subclasses: 	#(TwoModeButtonMorph)
		name: 	#ModeButtonMorph
		classPool: 	a Dictionary(#AuthorModeOwner->nil )
		sharedPools: 	nil
		environment: 	a SystemDictionary(lots of globals)
		category: 	nil

--- The rest of the stack ---
[] in ClassBuilder>>update:to:
BlockContext>>ensure:
BlockContext>>valueUnpreemptively
ClassBuilder>>update:to:
[] in ClassBuilder>>recompile:from:to:mutate:
[] in ClassBuilder>>informUserDuring:
MVCMenuMorph>>informUserAt:during:
Utilities class>>informUserDuring:
ClassBuilder>>informUserDuring:
ClassBuilder>>recompile:from:to:mutate:
ClassBuilder>>name:inEnvironment:subclassOf:type:instanceVariableNames:c
lassVariableNames:poolDictionaries:category:unsafe:
ClassBuilder>>name:inEnvironment:subclassOf:type:instanceVariableNames:c
lassVariableNames:poolDictionaries:category:
ClassBuilder>>superclass:subclass:instanceVariableNames:classVariableNam
es:poolDictionaries:category:
ProtoObject
class(Class)>>subclass:instanceVariableNames:classVariableNames:poolDict
ionaries:category:
UndefinedObject>>subclass:instanceVariableNames:classVariableNames:poolD
ictionaries:category:
UndefinedObject>>DoIt
Compiler>>evaluate:in:to:notifying:ifFail:
Compiler class>>evaluate:for:notifying:logged:
Compiler class>>evaluate:for:logged:
Compiler class>>evaluate:logged:
[] in StandardFileStream(PositionableStream)>>fileInAnnouncing:
BlockContext>>on:do:
[] in StandardFileStream(PositionableStream)>>fileInAnnouncing:
ProgressInitiationException>>defaultAction
ProgressInitiationException(Exception)>>signal
...etc...



More information about the Squeak-dev mailing list