Weird behavior where writing to an instance variable overwrites another instance variable instead

lex at cc.gatech.edu lex at cc.gatech.edu
Mon Oct 18 04:52:07 UTC 2004


If you happen to be able to work out a specific sequence of events to
duplicate the error that would help.

Did you use the menu item to add the instance variable?  If so, what
version of Squeak are you using?  I have had trouble using the "create
instance variable" menu item like you describe, but I thought that had
been fixed in recent Squeak's.

Lex


"Yar Hwee Boon" <hboon at motionobj.com> wrote:
> I'm getting a very weird behavior. Using Seaside, I have a method as below:
> 
> ACTransactionEditor>>addValidationError: aString
> 	validationErrors
> 		ifNil: [validationErrors := OrderedCollection new].
> 	^ validationErrors add: aString
> 
> ACTransactionEditor (a subclass of WAEditDialog, for those who use  
> Seaside), inherits the instance variable "decoration" from a superclass. I  
> define a instance variable called validationErrors. In the 3rd line of  
> #addValidationError:, the assignment to validationErrors actually assigns  
> to decoration instead, leaving validationErrors unchanged. I went through  
> the debugger a couple of times and can swear to it happening. It finally  
> work snormally after I put a self halt into #addValidationError:. After  
> that, removing the self halt, etc, the code still works (ie. I can't  
> reproduce it anymore).
> 
> Does anyone know what happened? Thanks.
> 
> -- 
> Regards
> HweeBoon
> MotionObj



More information about the Squeak-dev mailing list